Code

*.{default,init}: Added support for default files.
[pkg-nagixsc.git] / debian / nagixsc.nagixsc_conf2http.init
index 29d5ad4e39e6eebedfbc26e5e705193754ef0190..7f166b0c1921208ee06bc6c007ab73b589f80b77 100755 (executable)
@@ -17,7 +17,7 @@ DESC="Nag(IX)SC Conf2HTTP"
 NAME=nagixsc_conf2http
 DAEMONPATH=/usr/sbin
 DAEMON=$DAEMONPATH/$NAME
-DAEMON_ARGS="-c /etc/nagixsc/conf2http.cfg --daemon"
+DAEMON_ARGS="-c /etc/nagixsc/conf2http.cfg"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -25,7 +25,7 @@ SCRIPTNAME=/etc/init.d/$NAME
 [ -x "$DAEMON" ] || exit 0
 
 # Read configuration variable file if it is present
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
 # Load the VERBOSE setting and other rcS variables
 [ -f /etc/default/rcS ] && . /etc/default/rcS
@@ -34,6 +34,14 @@ SCRIPTNAME=/etc/init.d/$NAME
 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
 . /lib/lsb/init-functions
 
+# Check if RUN is set to "yes".
+if [ "x$RUN" != "xyes" ] ; then
+       echo "$NAME has been disabled in /etc/default/$NAME."
+       exit 0
+fi
+
+DAEMON_ARGS="$DAEMON_ARGS --daemon"
+
 is_running()
 {
        [ -f "$PIDFILE" ] || return 1