#! /bin/sh
#
# ircd          IRC server.  This script starts the ircd daemon.
#
# chkconfig: 345 97 13
# description: The IRC daemon runs an IRC server for use with Internet \
#              Relay Chat clients.
#
# processname: ircd
# pidfile: /var/run/ircd.pid
# config: /etc/sysconfig/network
# config: /etc/ircd/ircd.conf


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

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = "no" ]
then
	exit 0
fi

[ -f /usr/sbin/ircd ] || exit 0

# See how we were called.
case "$1" in
  start)
	gprintf "Starting IRC system: "
	daemon /usr/sbin/ircd
	echo
	touch /var/lock/subsys/ircd
	;;
  stop)
	gprintf "Stopping IRC service: "
	killproc ircd
	echo
	rm -f /var/lock/subsys/ircd
	;;
  status)
	status ircd
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	gprintf "Usage: %s {start|stop|status|restart}\n" "$0"
	exit 1
esac

exit 0
