#!/bin/bash # # ngircd This shell script takes care of starting and stopping # the ngircd IRC daemon. # # chkconfig: - 80 30 # description: ngircd is an IRC daemon # processname: ngircd # config: /etc/ngircd.conf # pidfile: /var/run/ngircd/ngircd.pid ### BEGIN INIT INFO # Provides: ngircd # Required-Start: $network $remote_fs # Required-Stop: $network $remote_fs # Default-Start: 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop the ngircd IRC daemon # Description: ngircd is an IRC daemon ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions prog=ngircd RETVAL=0 start() { echo -n $"Starting $prog: " daemon ngircd RETVAL=$? echo [ $RETVAL = 0 ] && touch /var/lock/subsys/ngircd return $RETVAL } stop() { echo -n $"Stopping $prog: " killproc ngircd RETVAL=$? echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/ngircd } reload() { echo -n $"Reloading $prog: " killproc ngircd -HUP RETVAL=$? echo } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status ngircd RETVAL=$? ;; restart) stop start ;; reload) reload ;; condrestart) if [ -f /var/run/ngircd/ngircd.pid ] ; then stop start fi ;; *) echo $"Usage: $prog {start|stop|restart|reload|condrestart|status|help}" RETVAL=1 esac exit $RETVAL