updated on Thu Jan 19 00:16:31 UTC 2012
[aur-mirror.git] / nagios / rc.nagios
blob6a03415c44a27ab55b9aa879e54894f27a028afa
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 NAGIOS_INIT="/etc/nagios/daemon-init"
7 case "$1" in
8 start)
9 stat_busy "Starting Nagios"
10 $NAGIOS_INIT start > /dev/null 2>&1
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 add_daemon nagios
15 stat_done
18 stop)
19 stat_busy "Stopping Nagios"
20 $NAGIOS_INIT stop > /dev/null 2>&1
21 if [ $? -gt 0 ]; then
22 stat_fail
23 else
24 rm_daemon nagios
25 stat_done
28 restart)
29 $0 stop
30 sleep 1
31 $0 start
33 reload|force-reload|status)
34 $NAGIOS_INIT $1
37 echo "usage: $0 {start|stop|restart|reload|force-reload|status}"
38 esac
39 exit 0