and_cesbo icon

Astra init.d script

and_cesbo | PRO | 12/03/14 06:46:47 AM UTC | 0 ⭐ | 946 👁️ | Never ⏰ | []
Bash |

650 B

|

None

|

0 👍

/

0 👎

#!/bin/sh
### BEGIN INIT INFO
# Provides:          astra
# Required-Start:    $network $syslog $named
# Required-Stop:     $network $syslog $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Astra init.d script for Ubuntu/Debian
### END INIT INFO
 
SCRIPT="/etc/astra/script.lua"
LOGFILE="/var/log/astra.log"
PIDFILE="/var/run/astra.pid"
 
case "$1" in
    start)
        /usr/bin/astra --stream --pid $PIDFILE --no-stdout --log $LOGFILE $SCRIPT &
        ;;
    stop)
        /bin/kill $(/bin/cat $PIDFILE)
        ;;
    *)
        echo "Usage: $0 [start|stop]"
        exit 1
        ;;
esac
 
exit 0

Comments