#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: %%NAME%%
# REQUIRE: LOGIN abi
# BEFORE:  securelevel
# KEYWORD: FreeBSD shutdown

# Add the following line to /etc/rc.conf to enable `%%NAME%%':
#
#%%NAME%%_enable="YES"
#
# See %%NAME%%(1) for %%NAME%%_flags
#

. "%%RC_SUBR%%"

name="%%NAME%%"
rcvar=`set_rcvar`

# use when the daemon uses SIGHUP to reparse its configuration files
# (you may defined sig_reload="USR1" when necessary)
#
#extra_commands="reload"

# path to your executable, might be libxec, bin, sbin, ...
command="%%PREFIX%%/sbin/$name"

# needed when your daemon is a perl script
#command_interpreter="%%PERL%%"

# extra required arguments
#command_args="--daemon"

# uncomment when the daemon creates a pid file (highly recommended).
#
#pidfile="/var/run/$name.pid"

# use when the daemon requires a configuration file to run,
#
#required_files="%%PREFIX%%/etc/$name.conf"

# you can check for required_dirs and required_vars too, see rc.subr(8)
#
#required_dirs="/var/log/$name"

# override stop_cmd when you don't want to terminate the daemon by SIGTERM
#
#stop_cmd="$command --quit"

# use the following when the daemon does not delete its pid file
#
#stop_postcmd="stop_postcmd"
#
#stop_postcmd()
#{
#  if ! rm "$pidfile" 2>/dev/null; then
#    warn "Couldn't remove $pidfile"
#  fi
#}

# read settings, set default values
load_rc_config "$name"
: ${%%NAME%%_enable="NO"}
: ${%%NAME%%_flags=""}

run_rc_command "$1"
