2010-05-11 22:54:57 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-04-30 02:03:28 +02:00
|
|
|
PIDFILE=
|
2010-05-11 22:54:57 +02:00
|
|
|
|
|
|
|
murmur_start() {
|
|
|
|
echo -n "Starting Murmur Server: "
|
|
|
|
if [ ! -f $PIDFILE ]; then
|
|
|
|
/usr/bin/murmurd -ini /etc/murmur.ini & > /dev/null 2>&1
|
|
|
|
echo "OK"
|
|
|
|
else
|
|
|
|
echo -n "Removing stale lock.. "
|
|
|
|
/bin/rm -f $PIDFILE
|
|
|
|
/usr/bin/murmurd -ini /etc/murmur.ini & > /dev/null 2>&1
|
|
|
|
echo "OK"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
murmur_stop() {
|
|
|
|
echo -n "Stopping Murmur: "
|
|
|
|
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.murmur {start|stop|restart}"
|
|
|
|
esac
|