God.pid_file_directory = '/tmp/god'

God.watch do |w|
  w.name = 'testscript'
  w.interval = 10.seconds # default
  w.start = "cd /tmp/god && ./testscript" 
  w.stop = "kill `/tmp/god/testscript.pid`"
  w.restart = "sleep 0"
  w.start_grace = 5.seconds
  w.behavior(:clean_pid_file)

  w.start_if do |start|
    start.condition(:process_running) do |c|
      c.interval = 5.seconds
      c.running = false
    end
  end
end