/rc0.d/K20distmp3
http://github.com/brinkman83/bashrc · Shell · 63 lines · 42 code · 11 blank · 10 comment · 6 complexity · 5a9dd89b1d6fcfab01250d8a35ad1b18 MD5 · raw file
- #! /bin/sh
- ### BEGIN INIT INFO
- # Provides: distmp3
- # Required-Start: $remote_fs $syslog
- # Required-Stop: $remote_fs $syslog
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- ### END INIT INFO
- # distmp3host Start/stop distmp3.
- # Version: distmp3host 0.1.9-4 04-Mar-2004 joshk@triplehelix.org
- PATH=/sbin:/bin:/usr/sbin:/usr/bin
- DAEMON=/usr/bin/distmp3host
- NAME=distmp3host
- DESC="distributed audio encoder"
- test -f $DAEMON || exit 0
- if [ -f "/etc/default/distmp3" ]; then
- . /etc/default/distmp3
-
- if [ "$1" = start ] && [ -n "$runlevel" -o -n "$in_postinst" ] && [ "$STARTME" = 0 ]; then
- echo "Not starting $DESC: dpkg-reconfigure distmp3 to change."
- exit 0
- fi
- if [ -n "$NICELEVEL" ]; then
- NICE="-N $NICELEVEL"
- fi
- fi
-
- set -e
- case "$1" in
- start)
- echo -n "Starting $DESC: $NAME"
- start-stop-daemon --start --quiet -c distmp3:distmp3 $NICE --exec $DAEMON
- echo "."
- ;;
- stop)
- echo -n "Stopping $DESC: $NAME"
- start-stop-daemon --oknodo --stop --quiet \
- --pidfile /var/run/distmp3/$NAME.pid --signal 15 >/dev/null
- echo "."
- ;;
- restart|force-reload)
- echo -n "Restarting $DESC: $NAME"
- start-stop-daemon --stop --quiet --oknodo --pidfile \
- /var/run/distmp3/$NAME.pid --signal 15 >/dev/null
- sleep 1
- start-stop-daemon --start --quiet -c distmp3:distmp3 $NICE --exec $DAEMON
- echo "."
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|force-reload}" >&2
- exit 1
- ;;
- esac
- exit 0