bot.sh 531 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. mydir=$(readlink -f $0)
  3. mydir=$(dirname "$mydir")
  4. case $1 in
  5. start)
  6. [ ! -d "${mydir}/logs" ] && mkdir "${mydir}/logs"
  7. "${mydir}/willie/willie.py" -c "${mydir}/ffpb.cfg" --fork
  8. ;;
  9. stop)
  10. "${mydir}/willie/willie.py" -c "${mydir}/ffpb.cfg" --quit
  11. ;;
  12. restart)
  13. "$0" stop
  14. sleep 2
  15. "$0" start
  16. ;;
  17. reload)
  18. echo "Not supported by script. Issue '!reload ffpb' in a query to reload the ffpb module."
  19. exit 2
  20. ;;
  21. *)
  22. echo "Unknown command. Please give 'start', 'stop' or 'restart'."
  23. exit 1
  24. ;;
  25. esac