fdn-accbot 709 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. ### BEGIN INIT INFO
  3. # Provides: perl
  4. # Required-Start:
  5. # Required-Stop:
  6. # Default-Start: 2 3 4 5
  7. # Default-Stop: 0 1 6
  8. # Short-Description: Lance le bot qui surveille le topic de #fdn
  9. # Description: Lance le bot qui surveille le topic de #fdn
  10. ### END INIT INFO
  11. case "$1" in
  12. start)
  13. echo "Starting fdn-accbot.pl..."
  14. /usr/local/bin/fdn-accbot.pl /var/www/fdn/index.html &
  15. ;;
  16. stop)
  17. echo "Stopping fdn-accbot.pl..."
  18. /bin/kill $(/bin/ps -eo '%p%a' | /bin/grep fdn-accbot | /bin/grep -v grep | /usr/bin/awk '{ print $1 }') 2> /dev/null
  19. ;;
  20. *)
  21. echo "Usage: $0 {start|stop}" >&2
  22. exit 1
  23. ;;
  24. esac
  25. exit 0