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
else
msg_already_running Nagios
fi
- ;;
-stop)
+}
+
+stop() {
# Stop daemons.
if [ -f /var/lock/subsys/nagios ]; then
msg_stopping Nagios
else
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
restart)
msg_reloading Nagios
checkconfig || exit && started
- $0 stop
- $0 start
+ stop
+ start
+ ;;
+status)
+ status nagios
exit $?
;;
*)