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