Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > ca39f12bd07d281b0f025eeb621faf15 > files > 3

ngircd-14.1-1mdv2010.0.i586.rpm

#!/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() {
        gprintf "Starting %s: " "$prog"
        daemon ngircd
        RETVAL=$?
	echo
        [ $RETVAL = 0 ] && touch /var/lock/subsys/ngircd
        return $RETVAL
}

stop() {
	gprintf "Stopping %s: " "$prog"
	killproc ngircd
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/ngircd
}

reload() {
	gprintf "Reloading %s: " "$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
	;;
  *)
	gprintf "Usage: %s {start|stop|restart|reload|condrestart|status|help}\n" "$prog"
	RETVAL=1
esac

exit $RETVAL