#!/bin/sh

#
# PROVIDE: biboumi
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# biboumi_enable (bool):        Set to NO by default.
#                               Set it to YES to enable biboumi.
# biboumi_config (path):        Set to %%PREFIX%%/etc/biboumi/biboumi.cfg
#                               by default.

. /etc/rc.subr

name=biboumi
rcvar=biboumi_enable
pidfile="/var/run/biboumi/biboumi.pid"
procname="%%PREFIX%%/bin/biboumi"

load_rc_config $name

: ${biboumi_enable:="NO"}
: ${biboumi_config="%%PREFIX%%/etc/biboumi/biboumi.cfg"}

command="/usr/sbin/daemon"
command_args="-p ${pidfile} -f ${procname} ${biboumi_config}"
extra_commands="reload"
required_files="$biboumi_config"
sig_reload="USR1"

biboumi_user="%%USER%%"
biboumi_group="%%GROUP%%"

run_rc_command "$1"
