]> arthur.barton.de Git - ngircd-alex.git/blobdiff - contrib/Debian/ngircd.init
Updated debian changelog.
[ngircd-alex.git] / contrib / Debian / ngircd.init
index 206e2f0e445e2d0c0b61331bfc69e6c32b5b7ba6..62373868818b6882e72048481202b270959cdee9 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # ngIRCd start and stop script for Debian-based systems
 #
-# $Id: ngircd.init,v 1.1 2003/12/31 17:20:11 alex Exp $
+# $Id: ngircd.init,v 1.6 2005/07/26 19:37:18 alex Exp $
 #
 
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
@@ -11,9 +11,12 @@ NAME=ngIRCd
 DESC="IRC daemon"
 PARAMS=""
 
-test -x $DAEMON || exit 0
+test -h "$0" && me=`readlink $0` || me="$0"
+BASENAME=`basename $me`
+
+test -f /etc/default/$BASENAME && . /etc/default/$BASENAME
 
-test -f /etc/default/ngircd && . /etc/default/ngircd
+test -x $DAEMON || exit 0
 
 Check_Config()
 {
@@ -27,6 +30,7 @@ Check_Config()
 
 Try_Start()
 {
+       [ ! -d /var/run/ircd ] || chown irc:irc /var/run/ircd
        start-stop-daemon --start --quiet --exec $DAEMON -- $PARAMS
        if [ $? -ne 0 ]; then
                echo "$NAME failed!"
@@ -43,7 +47,7 @@ case "$1" in
        ;;
   stop)
        echo -n "Stopping $DESC: "
-       start-stop-daemon --stop --quiet --exec $DAEMON \
+       start-stop-daemon --stop --quiet --pidfile /var/run/ircd/ngircd.pid --exec $DAEMON \
          && echo "$NAME." \
          || echo "(none running)"
        ;;