#!/bin/sh

# PROVIDE: ndo2db
# REQUIRE: DAEMON nagios
# BEFORE: LOGIN
# KEYWORD: shutdown

# Add the following lines to /etc/rc.conf to enable ndo2db:
# ndo2db_enable (bool):    Set to "NO" by default.
# ndo2db_flags (str):      Set to "" by default.
# ndo2db_configfile (str): Set to "%%PREFIX%%/etc/nagios/ndo2db.cfg" by default.

: ${ndo2db_enable="NO"}
: ${ndo2db_configfile="%%PREFIX%%/etc/nagios/ndo2db.cfg"}

. /etc/rc.subr

name="ndo2db"
rcvar=ndo2db_enable

command="%%PREFIX%%/bin/ndo2db-3x"
required_files="${ndo2db_configfile}"

load_rc_config $name

command_args="-c ${ndo2db_configfile}"

run_rc_command "$1"
