summaryrefslogtreecommitdiffstats
path: root/murmur/murmurd
diff options
context:
space:
mode:
Diffstat (limited to 'murmur/murmurd')
-rw-r--r--murmur/murmurd40
1 files changed, 40 insertions, 0 deletions
diff --git a/murmur/murmurd b/murmur/murmurd
new file mode 100644
index 0000000..630b49f
--- /dev/null
+++ b/murmur/murmurd
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# general config
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/murmurd`
+
+case "$1" in
+ start)
+ stat_busy "Starting Murmur Server"
+ [ -z $PID ] && /usr/sbin/murmurd -ini /etc/murmurd.ini & > /dev/null 2>&1
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ PID=`pidof -o %PPID /usr/sbin/murmurd`
+ echo $PID >/var/run/murmurd.pid
+ add_daemon murmurd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Murmur Server"
+ [ ! -z $PID ] && kill $PID & > /dev/null 2>&1
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon murmurd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0