aboutsummaryrefslogtreecommitdiff
path: root/network/mumble-server/rc.mumble-server
diff options
context:
space:
mode:
Diffstat (limited to 'network/mumble-server/rc.mumble-server')
-rw-r--r--network/mumble-server/rc.mumble-server44
1 files changed, 44 insertions, 0 deletions
diff --git a/network/mumble-server/rc.mumble-server b/network/mumble-server/rc.mumble-server
new file mode 100644
index 0000000000000..0a409067c22e0
--- /dev/null
+++ b/network/mumble-server/rc.mumble-server
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+PIDFILE=/var/run/mumble-server/mumble-server.pid
+
+murmur_start() {
+ echo -n "Starting Mumble-serverr: "
+ mkdir -p $(dirname $PIDFILE)
+ chown @USER@:@GROUP@ $(dirname $PIDFILE)
+
+ if [ ! -f $PIDFILE ]; then
+ /usr/bin/mumble-server -ini /etc/mumble-server.ini & > /dev/null 2>&1
+ echo "OK"
+ else
+ echo -n "Removing stale lock.. "
+ /bin/rm -f $PIDFILE
+ /usr/bin/mumble-server -ini /etc/mumble-server.ini & > /dev/null 2>&1
+ echo "OK"
+ fi
+}
+
+murmur_stop() {
+ echo -n "Stopping Mumble-server: "
+ if [ -f $PIDFILE ]; then
+ /bin/kill $(/bin/cat $PIDFILE)
+ /bin/rm -f $PIDFILE
+ echo "OK"
+ else
+ echo "Not Running"
+ fi
+}
+
+case "$1" in
+ start)
+ murmur_start
+ ;;
+ stop)
+ murmur_stop
+ ;;
+ restart)
+ murmur_stop && (/bin/sleep 1 && murmur_start)
+ ;;
+ *)
+ echo "Usage: rc.mumble-server {start|stop|restart}"
+esac