3 # ngIRCd start and stop script for RedHat based distributions.
4 # Written by Naoya Nakazawa <naoya.n@gmail.com> for CentOS 5.2, 2009.
7 # description: ngIRCd is an Open Source server for \
8 # the Internet Relay Chat (IRC), which \
9 # is developed and published under \
10 # the terms of the GNU General Public
11 # Licence (URL: http://www.gnu.org/licenses/gpl.html). \
12 # ngIRCd means "next generation IRC daemon", \
13 # it's written from scratch and not deduced from the \
14 # "grandfather of IRC daemons", the daemon of the IRCNet.
16 # processname: /usr/sbin/ngircd
18 # pidfile: /var/run/ngircd.pid
20 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
21 DAEMON=/usr/sbin/ngircd
24 CONF=/etc/$BASENAME.conf
28 # Source function library.
29 . /etc/init.d/functions
32 test -f /etc/sysconfig/network && . /etc/sysconfig/network
33 test -f /etc/sysconfig/makuosan && . /etc/sysconfig/makuosan
35 # Check that networking is up.
36 [ "${NETWORKING}" = "yes" ] || exit 0
38 [ -x $DAEMON ] || exit 1
39 [ -f $CONF ] || exit 2
44 echo -n $"Starting $NAME: "
45 daemon $DAEMON $PARAMS
47 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$BASENAME
53 echo -n $"Stopping $NAME: "
56 if [ $RETVAL -eq 0 ] ; then
57 rm -f /var/lock/subsys/$BASENAME
64 echo -n $"Reloading configuration: "
77 [ -e /var/lock/subsys/$BASENAME ] && restart
82 $DAEMON $PARAMS --configtest >/dev/null 2>&1
83 [ $? -eq 0 ] && return 0
85 echo -n $"Configuration of $NAME is not valid, won't (re)start!"
86 echo -n $"Run \"$DAEMON --configtest\" and fix it up ..."
90 # See how we were called.
115 echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|test}"