#!/bin/sh

#
# You probably want to set the path to include
# nothing but local filesystems.
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH

M=/usr/lib/mon
PID=/var/run/mon.pid

case "$1" in
    start)
	if [ -x $M/mon ]
	then
	    $M/mon -c $M/mon.cf -a $M/alert.d \
	    	-s $M/mon.d -f 2>/dev/null
	fi
	;;
    stop)
	kill -TERM `cat $PID`
	;;
    *)
    	echo "Usage: mon {start|stop}"
	exit 1
esac

exit 0
