run.sh 486 B

123456789101112131415161718
  1. #!/bin/bash
  2. # This shell script runs funbot, but only if it isn't running already. You can
  3. # use it in a crob job, to periodically relaunch the bot if it crashes. For
  4. # example, to check every 10 minutes:
  5. #
  6. # # m h dom mon dow command
  7. # */10 * * * * ~/funbot/util/run.sh
  8. #
  9. # (Use `crontab -e` to edit your cron table,
  10. # see `man 1 crontab` and `man 5 crontab`)
  11. ps cax | grep funbot > /dev/null
  12. if [ $? -ne 0 ]; then
  13. cd ~/funbot
  14. ./dist/build/funbot/funbot &
  15. fi