#!/bin/sh
# PROVIDE: ngircd
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to run ngircd:
#
# ngircd_enable (bool): Set it to "YES" to enable ngircd.
# Default is "NO".
# ngircd_conf (file): Set local of config file.
# Default is "%%ETCDIR%%/ngircd.conf".
# ngircd_flags (flags): Set extra flags here. More options in ngircd(1)
# Default is empty "".
#
. /etc/rc.subr
name="ngircd"
rcvar="ngircd_enable"
load_rc_config $name
: ${ngircd_enable="NO"}
: ${ngircd_conf="%%ETCDIR%%/ngircd.conf"}
required_files="${ngircd_conf}"
command=%%PREFIX%%/sbin/ngircd
command_args="--config ${ngircd_conf}"
start_precmd=do_precmd
do_precmd()
{
if ! ${command} ${command_args} --configtest > /dev/null; then
echo "ERROR: '${ngircd_conf}' incorrectly configured" >&2
exit 78 # EX_CONFIG
fi
}
run_rc_command "$1"