#!/bin/sh
#
# $FreeBSD: ports/sysutils/monit/files/monit.sh.in,v 1.1 2005/10/11 02:50:45 mnag Exp $
#

# PROVIDE: monit
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable monit:
# monit_enable (bool):        Set to "NO" by default.
#                             Set it to "YES" to enable monit
#
. /etc/rc.subr

name="monit"
rcvar=`set_rcvar`

restart_precmd="monit_checkconfig"
reload_precmd="monit_checkconfig"

default_config=/usr/local/etc/monitrc
required_files=${default_config}
command="/usr/local/bin/monit"
command_args="-c ${default_config}"
pidfile="/var/run/monit.pid"

[ -z "$monit_enable" ] && monit_enable="NO"

load_rc_config $name

monit_checkconfig()
{
	echo "Performing sanity check on monit configuration:"
	${command} ${command_args} -t
}

extra_commands="reload"
run_rc_command "$1"


syntax highlighted by Code2HTML, v. 0.9.1