Allow load_rc_config to be called without a service name.

MFC after:	1 week
This commit is contained in:
Dag-Erling Smørgrav 2014-12-01 12:17:42 +00:00
parent c25290420e
commit e27961a496

View File

@ -1315,9 +1315,6 @@ load_rc_config()
{ {
local _name _rcvar_val _var _defval _v _msg _new _d local _name _rcvar_val _var _defval _v _msg _new _d
_name=$1 _name=$1
if [ -z "$_name" ]; then
err 3 'USAGE: load_rc_config name'
fi
if ${_rc_conf_loaded:-false}; then if ${_rc_conf_loaded:-false}; then
: :
@ -1333,6 +1330,9 @@ load_rc_config()
_rc_conf_loaded=true _rc_conf_loaded=true
fi fi
# If a service name was specified, attempt to load
# service-specific configuration
if [ -n "$_name" ] ; then
for _d in /etc ${local_startup%*/rc.d}; do for _d in /etc ${local_startup%*/rc.d}; do
if [ -f ${_d}/rc.conf.d/"$_name" ]; then if [ -f ${_d}/rc.conf.d/"$_name" ]; then
debug "Sourcing ${_d}/rc.conf.d/$_name" debug "Sourcing ${_d}/rc.conf.d/$_name"
@ -1347,6 +1347,7 @@ load_rc_config()
done done
fi fi
done done
fi
# Set defaults if defined. # Set defaults if defined.
for _var in $rcvar $rcvars; do for _var in $rcvar $rcvars; do