#!/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/ircd ] && exit 0
	echo "Starting IRC server (HYBRID)... "

	WD=`pwd`;
	su pasky -c "/home/pasky/ircd/ircd" &
	cd $WD

	touch /var/lock/subsys/ircd
	;;
  stop)
	echo "Stopping IRC server (ALL)... "
	
	rm -f /var/lock/subsys/ircd
	
	killall ircd # 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

