updated on Wed Jan 25 08:34:36 UTC 2012
[aur-mirror.git] / nagios-nsca / rc.nsca
blob036b493ec224bbada67e862aa58d1a70fff1e43d
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof -o %PPID /usr/sbin/nsca`
8 start() {
9 stat_busy "Starting NSCA"
10 [ -z "$PID" ] && /usr/sbin/nsca -c /etc/nsca/nsca.cfg --daemon
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 add_daemon nsca
15 stat_done
19 stop() {
20 stat_busy "Stopping NSCA"
21 [ ! -z "$PID" ] && kill $PID &> /dev/null
22 if [ $? -gt 0 ]; then
23 stat_fail
24 else
25 rm_daemon nsca
26 stat_done
30 case "$1" in
31 start)
32 start
34 stop)
35 stop
37 restart)
38 stop
39 sleep 3
40 start
43 echo "usage: $0 {start|stop|restart}"
44 esac
45 exit 0