5 pidfile
="/run/monitorix.pid"
6 if [[ -r $pidfile ]]; then
7 read -r PID
< "$pidfile"
8 if [[ ! -d /proc
/$PID ]]; then
9 unset PID
&& rm -f "$pidfile" # stale pidfile
13 args
=(-c /etc
/monitorix.conf
-p "$pidfile")
17 stat_busy
"Starting Monitorix"
18 if [[ -z $PID ]] && /usr
/bin
/monitorix
"${args[@]}"; then
28 stat_busy
"Stopping Monitorix"
29 if [[ $PID ]] && kill $PID &> /dev
/null
; then
31 [[ -f $pidfile ]] && rm -f $pidfile
46 echo "usage: $0 {start|stop|restart}"