sintonia/python_apps/pypo/airtime-playout-init-d
martin 79e24e5af5 cc-2055: switch to init.d
-Change all python apps to log directly to file
-change airtime-pypo to airtime-playback
-fix airtime install started/completed message bumpers
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-playout
PIDFILE=/var/run/airtime.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