Code

*.{default,init}: Added support for default files.
[pkg-nagixsc.git] / debian / nagixsc.nagixsc_http2nagios.init
index ee21ca131c4ca4603d0691ed7dc49a363590e5c1..7898122cf130edc8a7a17e99c6a1d8963fc21ddc 100755 (executable)
@@ -17,7 +17,7 @@ DESC="Nag(IX)SC HTTP2Nagios"
 NAME=nagixsc_http2nagios
 DAEMONPATH=/usr/sbin
 DAEMON=$DAEMONPATH/$NAME
-DAEMON_ARGS="-c /etc/nagixsc/http2nagios.cfg --daemon"
+DAEMON_ARGS="-c /etc/nagixsc/http2nagios.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