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,20 +1330,24 @@ load_rc_config()
_rc_conf_loaded=true _rc_conf_loaded=true
fi fi
for _d in /etc ${local_startup%*/rc.d}; do # If a service name was specified, attempt to load
if [ -f ${_d}/rc.conf.d/"$_name" ]; then # service-specific configuration
debug "Sourcing ${_d}/rc.conf.d/$_name" if [ -n "$_name" ] ; then
. ${_d}/rc.conf.d/"$_name" for _d in /etc ${local_startup%*/rc.d}; do
elif [ -d ${_d}/rc.conf.d/"$_name" ] ; then if [ -f ${_d}/rc.conf.d/"$_name" ]; then
local _rc debug "Sourcing ${_d}/rc.conf.d/$_name"
for _rc in ${_d}/rc.conf.d/"$_name"/* ; do . ${_d}/rc.conf.d/"$_name"
if [ -f "$_rc" ] ; then elif [ -d ${_d}/rc.conf.d/"$_name" ] ; then
debug "Sourcing $_rc" local _rc
. "$_rc" for _rc in ${_d}/rc.conf.d/"$_name"/* ; do
fi if [ -f "$_rc" ] ; then
done debug "Sourcing $_rc"
fi . "$_rc"
done fi
done
fi
done
fi
# Set defaults if defined. # Set defaults if defined.
for _var in $rcvar $rcvars; do for _var in $rcvar $rcvars; do