mumble/scripts/murmur.init
Thorvald Natvig f76f28b7f8 Typo in murmur.init
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@846 05730e5d-ab1b-0410-a4ac-84af385074fa
2007-11-08 11:08:48 +00:00

100 lines
2.1 KiB
Bash
Executable File

#! /bin/sh
#
### BEGIN INIT INFO
# Provides: murmur
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Should-Start: $mysql
# Should-Stop: $mysql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Murmur VoIP Server
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=murmur
DESC="Murmur VoIP Server"
PIDFILE=/var/run/murmur/murmur.pid
DAEMON=/usr/sbin/murmurd
test -x $DAEMON || exit 0
INIFILE=/etc/murmur.ini
DAEMON_OPTS="-ini $INIFILE"
# Include murmur defaults if available
if [ -f /etc/default/murmur ] ; then
. /etc/default/murmur
fi
. /lib/init/vars.sh
. /lib/lsb/init-functions
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --quiet \
--pidfile $PIDFILE \
--chuid Murmur:Murmur \
--exec $DAEMON \
-- $DAEMON_OPTS
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --quiet \
--retry=TERM/30/KILL/5 \
--pidfile $PIDFILE \
--user Murmur \
--exec $DAEMON
case "$?" in
0|1) rm -f $PIDFILE
[ "$VERBOSE" != no ] && log_end_msg 0
;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
force-reload)
start-stop-daemon --stop --test --quiet \
--pidfile $PIDFILE \
--user Murmur \
--exec $DAEMON \
&& $0 restart || exit 0
;;
restart)
[ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME"
start-stop-daemon --stop --quiet \
--retry=TERM/30/KILL/5 \
--pidfile $PIDFILE \
--user Murmur \
--exec $DAEMON
case "$?" in
0|1)
rm -f $PIDFILE
start-stop-daemon --start --quiet \
--pidfile $PIDFILE \
--chuid Murmur:Murmur \
--exec $DAEMON \
-- $DAEMON_OPTS
case "$?" in
0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
*) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
*)
[ "$VERBOSE" != no ] && log_end_msg 0
;;
esac
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 3
;;
esac
exit 0