Nicer (?) button.
[adorno.git] / debian / adorno.init
blob6c81293c06be534e9517018c754c7aef075f65fd
1 #! /bin/sh
2 # $Id: $
4 # An init script for adorno
6 # Witten for adorno by Andrew McMillan <awm@debian.org>
8 set -e
10 NAME=adorno
12 FIFO=/var/run/${NAME}/fifo
13 DAEMON=/usr/local/sbin/${NAME}
14 PIDFILE=/var/run/${NAME}/${NAME}.pid
16 test -x $DAEMON || exit 0
18 case "$1" in
19 start)
20 echo -n "Starting Music Server Daemon: "
21 if [ ! -p ${FIFO} ] ; then
22 mknod -m 666 ${FIFO} p
24 start-stop-daemon --background --start --exec $DAEMON
25 echo "$NAME."
27 stop)
28 echo -n "Stopping Music Server Daemon: "
29 start-stop-daemon --stop --oknodo --pidfile ${PIDFILE}
30 echo "$NAME."
31 rm ${FIFO} ${PIDFILE}
33 restart|reload|force-reload)
34 echo -n "Restarting Music Server Daemon: "
35 start-stop-daemon --stop --oknodo --pidfile /var/run/adorno/adorno.pid
36 sleep 2
37 echo -n "stopped "
38 start-stop-daemon --background --start --exec $DAEMON
39 echo "started $NAME."
42 echo "Usage: /etc/init.d/$NAME {start|stop|reload}"
43 exit 1
45 esac
47 exit 0