#!/bin/bash

# chkconfig: 345 85 15
# description: Runs and kills MultiMedia Panel at boot time and shutdown.

# Source function library.
#. /etc/rc.d/init.d/functions

# See how we were called.
case "$1" in
  start)
    [ -f /var/lock/subsys/mush ] && exit 0
	echo "Starting Ethereal MUSH... "

	su -c /opt/pennmush/game/restart pennmush

	touch /var/lock/subsys/mush
	;;
  stop)
	echo "Stopping Ethereal MUSH... "
	
	rm -f /var/lock/subsys/mush
	
	killall netmush # warning! must be last command ;-)
	;;
  restart)
	$0 stop
        $0 start
	;;
#  status)
#	status mmp
#	;;
  *)
	echo "Usage: $0 {start|stop|restart}" #p|status|r
	exit 1
esac

exit 0

