2010-12-16 16:12:21 +01:00
|
|
|
#! /bin/bash
|
|
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: mumble-server
|
|
|
|
# Required-Start: $network $local_fs $remote_fs dbus
|
|
|
|
# Required-Stop: $network $local_fs $remote_fs dbus
|
|
|
|
# Should-Start: mysql
|
|
|
|
# Should-Stop: mysql
|
|
|
|
# Default-Start: 3 5
|
|
|
|
# Default-Stop: 0 1 2 6
|
|
|
|
# Short-Description: Mumble VoIP Server
|
|
|
|
### END INIT INFO
|
|
|
|
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|
|
|
NAME=mumble-server
|
|
|
|
PIDDIR=/var/run/$NAME
|
|
|
|
PIDFILE=$PIDDIR/$NAME.pid
|
|
|
|
DAEMON=/usr/sbin/murmurd
|
|
|
|
USER=mumble-server
|
|
|
|
GROUP=mumble-server
|
|
|
|
|
|
|
|
INIFILE=/etc/mumble-server.ini
|
|
|
|
DAEMON_OPTS="-ini $INIFILE"
|
|
|
|
|
|
|
|
# Include murmur defaults if available
|
|
|
|
if [ -f /etc/default/$NAME ] ; then
|
|
|
|
. /etc/default/$NAME
|
|
|
|
fi
|
|
|
|
|
|
|
|
. /etc/rc.status
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
echo -n "Starting $NAME "
|
2011-03-08 17:34:44 +01:00
|
|
|
test -d $PIDDIR || /usr/bin/install -d -m 0755 -o mumble-server -g mumble-server $PIDDIR
|
|
|
|
/sbin/start_daemon -p $PIDFILE $DAEMON $DAEMON_OPTS
|
|
|
|
rc_status -v
|
2010-12-16 16:12:21 +01:00
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
echo -n "Shutting down $NAME "
|
|
|
|
killproc -p $PIDFILE -TERM $DAEMON
|
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
try-restart|condrestart)
|
|
|
|
$0 status
|
|
|
|
if test $? = 0; then
|
|
|
|
$0 restart
|
|
|
|
else
|
|
|
|
rc_reset # Not running is not a failure.
|
|
|
|
fi
|
|
|
|
# Remember status and be quiet
|
|
|
|
rc_status
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
$0 start
|
|
|
|
rc_status
|
|
|
|
;;
|
|
|
|
force-reload)
|
|
|
|
$0 try-restart
|
|
|
|
rc_status
|
|
|
|
;;
|
|
|
|
reload)
|
|
|
|
rc_failed 3
|
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
echo -n "Checking for service $NAME "
|
|
|
|
/sbin/checkproc $DAEMON
|
|
|
|
rc_status -v
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
rc_exit
|