sintonia/python_apps/show-recorder/airtime-show-recorder-init-d
martin 079d9d36b0 cc-2055: switch to init.d
-fix uninstall scripts
-make daemon script for media-monitor and show-recorder
-create pid file for liquidsoap
-fix airtime-check-system
-make sure all startup scripts are using exec
2011-06-02 18:07:47 -04:00

49 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
USERID=pypo
GROUPID=pypo
NAME=Airtime
DAEMON=/usr/bin/airtime-show-recorder
PIDFILE=/var/run/airtime-show-recorder.pid
start () {
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE --startas $DAEMON
}
stop () {
# Send TERM after 5 seconds, wait at most 30 seconds.
start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --pidfile $PIDFILE
rm -f $PIDFILE
}
case "${1:-''}" in
'start')
# start commands here
echo -n "Starting $NAME: "
start
echo "Done."
;;
'stop')
# stop commands here
echo -n "Stopping $NAME: "
stop
echo "Done."
;;
'restart')
# restart commands here
echo -n "Restarting $NAME: "
stop
start
echo "Done."
;;
'status')
# status commands here
/usr/bin/airtime-check-system
;;
*) # no parameter specified
echo "Usage: $SELF start|stop|restart|status"
exit 1
;;
esac