kill-stale.sh 270 B

123456789
  1. #!/bin/sh
  2. # Should be added to cron like this:
  3. # * * * * * /home/enikesha/quicklisp/local-projects/chatikbot/kill-stale.sh
  4. DIR="$(dirname "$0")"
  5. test `find "$DIR/.watchdog" -mmin +2` || exit
  6. # Kill exising process
  7. pid=`lsof -iTCP:4016 -sTCP:LISTEN -t` && kill -9 $pid