rc.subr (264438) | rc.subr (271260) |
---|---|
1# $NetBSD: rc.subr,v 1.67 2006/10/07 11:25:15 elad Exp $ | 1# $NetBSD: rc.subr,v 1.67 2006/10/07 11:25:15 elad Exp $ |
2# $FreeBSD: stable/10/etc/rc.subr 264438 2014-04-14 01:44:56Z dteske $ | 2# $FreeBSD: stable/10/etc/rc.subr 271260 2014-09-08 11:18:27Z des $ |
3# 4# Copyright (c) 1997-2004 The NetBSD Foundation, Inc. 5# All rights reserved. 6# 7# This code is derived from software contributed to The NetBSD Foundation 8# by Luke Mewburn. 9# 10# Redistribution and use in source and binary forms, with or without --- 1254 unchanged lines hidden (view full) --- 1265} 1266 1267# 1268# load_rc_config name 1269# Source in the configuration file for a given name. 1270# 1271load_rc_config() 1272{ | 3# 4# Copyright (c) 1997-2004 The NetBSD Foundation, Inc. 5# All rights reserved. 6# 7# This code is derived from software contributed to The NetBSD Foundation 8# by Luke Mewburn. 9# 10# Redistribution and use in source and binary forms, with or without --- 1254 unchanged lines hidden (view full) --- 1265} 1266 1267# 1268# load_rc_config name 1269# Source in the configuration file for a given name. 1270# 1271load_rc_config() 1272{ |
1273 local _name _rcvar_val _var _defval _v _msg _new | 1273 local _name _rcvar_val _var _defval _v _msg _new _d |
1274 _name=$1 1275 if [ -z "$_name" ]; then 1276 err 3 'USAGE: load_rc_config name' 1277 fi 1278 1279 if ${_rc_conf_loaded:-false}; then 1280 : 1281 else 1282 if [ -r /etc/defaults/rc.conf ]; then 1283 debug "Sourcing /etc/defaults/rc.conf" 1284 . /etc/defaults/rc.conf 1285 source_rc_confs 1286 elif [ -r /etc/rc.conf ]; then 1287 debug "Sourcing /etc/rc.conf (/etc/defaults/rc.conf doesn't exist)." 1288 . /etc/rc.conf 1289 fi 1290 _rc_conf_loaded=true 1291 fi | 1274 _name=$1 1275 if [ -z "$_name" ]; then 1276 err 3 'USAGE: load_rc_config name' 1277 fi 1278 1279 if ${_rc_conf_loaded:-false}; then 1280 : 1281 else 1282 if [ -r /etc/defaults/rc.conf ]; then 1283 debug "Sourcing /etc/defaults/rc.conf" 1284 . /etc/defaults/rc.conf 1285 source_rc_confs 1286 elif [ -r /etc/rc.conf ]; then 1287 debug "Sourcing /etc/rc.conf (/etc/defaults/rc.conf doesn't exist)." 1288 . /etc/rc.conf 1289 fi 1290 _rc_conf_loaded=true 1291 fi |
1292 if [ -f /etc/rc.conf.d/"$_name" ]; then 1293 debug "Sourcing /etc/rc.conf.d/${_name}" 1294 . /etc/rc.conf.d/"$_name" 1295 fi | |
1296 | 1292 |
1293 for _d in /etc ${local_startup%*/rc.d}; do 1294 if [ -f ${_d}/rc.conf.d/"$_name" ]; then 1295 debug "Sourcing ${_d}/rc.conf.d/$_name" 1296 . ${_d}/rc.conf.d/"$_name" 1297 elif [ -d ${_d}/rc.conf.d/"$_name" ] ; then 1298 local _rc 1299 for _rc in ${_d}/rc.conf.d/"$_name"/* ; do 1300 if [ -f "$_rc" ] ; then 1301 debug "Sourcing $_rc" 1302 . "$_rc" 1303 fi 1304 done 1305 fi 1306 done 1307 |
|
1297 # Set defaults if defined. 1298 for _var in $rcvar; do 1299 eval _defval=\$${_var}_defval 1300 if [ -n "$_defval" ]; then 1301 eval : \${$_var:=\$${_var}_defval} 1302 fi 1303 done 1304 --- 714 unchanged lines hidden --- | 1308 # Set defaults if defined. 1309 for _var in $rcvar; do 1310 eval _defval=\$${_var}_defval 1311 if [ -n "$_defval" ]; then 1312 eval : \${$_var:=\$${_var}_defval} 1313 fi 1314 done 1315 --- 714 unchanged lines hidden --- |