and_cesbo

Astra init.d script

Dec 3rd, 2014
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.65 KB | None | 0 0
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          astra
  4. # Required-Start:    $network $syslog $named
  5. # Required-Stop:     $network $syslog $named
  6. # Default-Start:     2 3 4 5
  7. # Default-Stop:      0 1 6
  8. # Short-Description: Astra init.d script for Ubuntu/Debian
  9. ### END INIT INFO
  10.  
  11. SCRIPT="/etc/astra/script.lua"
  12. LOGFILE="/var/log/astra.log"
  13. PIDFILE="/var/run/astra.pid"
  14.  
  15. case "$1" in
  16.     start)
  17.         /usr/bin/astra --stream --pid $PIDFILE --no-stdout --log $LOGFILE $SCRIPT &
  18.         ;;
  19.     stop)
  20.         /bin/kill $(/bin/cat $PIDFILE)
  21.         ;;
  22.     *)
  23.         echo "Usage: $0 [start|stop]"
  24.         exit 1
  25.         ;;
  26. esac
  27.  
  28. exit 0
Advertisement
Add Comment
Please, Sign In to add comment