Tune up the rc.d script a bit:

1. Change default variable assignments at the top to comments (two of
them were assigning empty default values).
2. Move the default for _enable to below load_rc_config
3. Add the _ifaces and _server options to command_args which eliminates
the need for the precmd
4. s#/usr/local#%%PREFIX%%#
This commit is contained in:
Doug Barton 2009-07-20 18:49:57 +00:00
parent 26174263bb
commit bcff5ac5ad
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=238123

View File

@ -9,27 +9,22 @@
#
# dhcprelay_enable="YES"
#
# override these variables in /etc/rc.conf
dhcprelay_enable=${dhcprelay_enable:-"NO"}
dhcprelay_server=${dhcprelay_server:-} # dhcprelay server(s)
dhcprelay_ifaces=${dhcprelay_ifaces:-} # ethernet interface(s)
dhcprelay_precmd ()
{
rc_flags="${rc_flags} ${dhcprelay_ifaces} ${dhcprelay_server}"
}
# dhcprelay_server="" # dhcprelay server(s)
# dhcprelay_ifaces="" # ethernet interface(s)
. %%RC_SUBR%%
name=dhcprelay
rcvar=$(set_rcvar)
pidfile=/var/run/${name}.pid
command=/usr/local/bin/${name}
command=%%PREFIX%%/bin/${name}
command_args="${dhcprelay_ifaces} ${dhcprelay_server}"
start_precmd=${name}_precmd
echo $rc_flags
# echo $rc_flags
load_rc_config ${name}
dhcprelay_enable=${dhcprelay_enable:"NO"}
run_rc_command "$1"