aboutsummaryrefslogtreecommitdiff
path: root/munin/rc.munin-node
blob: f7cec18dde9e95e9db7188acee8b651ac1361df9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
#
# startup script for munin-node
#

PID_FILE="/var/run/munin/munin-node.pid"

if [ -a "/var/run/munin/munin-node.pid" ]; then
  NODE_PID="`cat $PID_FILE`"            
fi

function munin_start {
  /usr/sbin/munin-node
}

function munin_stop {
  if [ "$NODE_PID" == "`pidof munin-node`" ]; then
    kill $NODE_PID
  fi
}

if [ "$1" == "start" ]; then
  munin_start
elif [ "$1" == "stop" ]; then
  munin_stop
elif [ "$1" == "restart" ]; then
  munin_stop
  munin_start
fi