freebsd-ports/sysutils/munin-node/files/munin-node.sh
Mathieu Arnold 9623c63f0c Add Munin network-wide graphing framework (node)
This is the node part. It is used on all machines Munin shall watch.

PR:		ports/62479
Submitted by:	Lupe Christoph <lupe@lupe-christoph.de>
2004-03-02 15:54:05 +00:00

26 lines
486 B
Bash

#!/bin/sh
PROGRAM=%PREFIX%/sbin/munin-node
CONFIG=%PREFIX%/etc/munin/munin-node.conf
case "$1" in
start)
if [ -x $PROGRAM -a -f $CONFIG -a -d $PLUGINS ]; then
$PROGRAM --config $CONFIG && echo -n ' munin-node'
fi
;;
stop)
if [ -f $CONFIG ]; then
PIDFILE=`awk '$1 == "pid_file" { print $2 }' $CONFIG`
if [ -f $PIDFILE ]; then
/bin/kill `cat $PIDFILE` && echo -n ' munin-node'
fi
fi
;;
*)
echo "Usage: `basename $0` { start | stop }"
exit 64
;;
esac