#!/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/mmp ] && exit 0
	echo "Starting MultiMedia Panel... "

	/usr/local/bin/mmp -c 11 -q

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

exit 0

