]> git.pld-linux.org Git - packages/nagios.git/blobdiff - nagios.init
- fix html syntax
[packages/nagios.git] / nagios.init
index 891ea6b004f753dc92bebe285c54f2ccd2353419..f8094c09c120136e0d058ea172094eecd077f4d3 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# nagios       Host/service/network monitoring daemon
+# Nagios       Host/service/network monitoring daemon
 #
 # chkconfig:   345 85 24
 # description: Host/service/network monitoring daemon which uses snort as NIDS
@@ -18,7 +18,7 @@
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
        if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
-               msg_network_down nagios
+               msg_network_down Nagios
                exit 1
        fi
 else
@@ -35,13 +35,10 @@ checkconfig() {
        return $rc
 }
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/nagios ]; then
-               msg_starting nagios
+               msg_starting Nagios
                checkconfig || exit
 
                # remove stale cmd pipe (or nagios won't start if it exists)
@@ -52,22 +49,29 @@ start)
                        touch /var/lock/subsys/nagios
                fi
        else
-               msg_already_running nagios
+               msg_already_running Nagios
        fi
-       ;;
-stop)
+}
+
+stop() {
        # Stop daemons.
        if [ -f /var/lock/subsys/nagios ]; then
-               msg_stopping nagios
+               msg_stopping Nagios
                killproc nagios -TERM
                rm -f /var/lock/subsys/nagios > /dev/null 2>&1
        else
-               msg_not_running nagios
+               msg_not_running Nagios
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+start)
+       start
        ;;
-status)
-       status nagios
-       exit $?
+stop)
+       stop
        ;;
 checkconfig|check|configtest)
        /usr/sbin/nagios -v /etc/nagios/nagios.cfg
@@ -75,21 +79,24 @@ checkconfig|check|configtest)
        ;;
 reload|force-reload)
        if [ -f /var/lock/subsys/nagios ]; then
-               msg_reloading nagios
+               msg_reloading Nagios
                checkconfig || exit
 
                killproc nagios -HUP
                RETVAL=$?
        else
-               msg_not_running nagios >&2
+               msg_not_running Nagios
                exit 7
        fi
        ;;
 restart)
-       msg_reloading nagios
+       msg_reloading Nagios
        checkconfig || exit && started
-       $0 stop
-       $0 start
+       stop
+       start
+       ;;
+status)
+       status nagios
        exit $?
        ;;
 *)
This page took 0.035569 seconds and 4 git commands to generate.