Allow rc_need to work with net scripts, and allow for loopback also.

This commit is contained in:
Roy Marples 2008-01-30 13:20:47 +00:00
parent 4bdfccc2c2
commit 0c75e888fc
2 changed files with 19 additions and 22 deletions

View File

@ -559,7 +559,7 @@
#vlan_start_eth0="no"
# If you do the above then you may want to depend on eth0 like so
# RC_NEED_vlan1="net.eth0"
# rc_need_vlan1="net.eth0"
# NOTE: depend functions only work in /etc/conf.d/net
# and not in profile configs such as /etc/conf.d/net.foo
@ -573,7 +573,7 @@
# If any of the slaves require extra configuration - for example wireless or
# ppp devices - we need to depend function on the bonded interfaces
#RC_NEED_bond0="net.eth0 net.eth1"
#rc_need_bond0="net.eth0 net.eth1"
#-----------------------------------------------------------------------------
@ -690,7 +690,7 @@
# If the link require extra configuration - for example wireless or
# RFC 268 bridge - we need to depend on the bridge so they get
# configured correctly.
#RC_NEED_ppp0="net.nas0"
#rc_need_ppp0="net.nas0"
#WARNING: if MTU of the PPP interface is less than 1500 and you use this
#machine as a router, you should add the following rule to your firewall
@ -792,7 +792,7 @@
# If any of the ports require extra configuration - for example wireless or
# ppp devices - we need to depend on them like so.
#RC_NEED_br0="net.eth0 net.eth1"
#rc_need_br0="net.eth0 net.eth1"
# Below is an example of configuring the bridge
# Consult "man brctl" for more details
@ -836,7 +836,7 @@
# link_6to4="eth0" # Interface to base it's addresses on
# config_6to4="ip6to4"
# You may want to depend on eth0 like so
#RC_NEED_6to4="net.eth0"
#rc_need_6to4="net.eth0"
# To ensure that eth0 is configured before 6to4. Of course, the tunnel could be
# any name and this also works for any configured interface.
# NOTE: If you're not using iproute2 then your 6to4 tunnel has to be called

View File

@ -21,26 +21,23 @@ depend()
need localmount
after bootmisc
provide net
case "${IFACE}" in
lo|lo0);;
*)
after net.lo net.lo0
if type depend_${IFVAR} >/dev/null 2>&1; then
depend_${IFVAR}
fi
local prov=
eval prov=\$RC_NEED_${IFVAR}
[ -n "${prov}" ] && need ${prov}
eval prov=\$RC_USE_${IFVAR}
[ -n "${prov}" ] && use ${prov}
eval prov=\$RC_BEFORE_${IFVAR}
[ -n "${prov}" ] && before ${prov}
eval prov=\$RC_AFTER_${IFVAR}
[ -n "${prov}" ] && after ${prov}
eval prov=\$RC_PROVIDE_${IFVAR}
[ -n "${prov}" ] && provide ${prov}
;;
*) after net.lo net.lo0;;
esac
if type depend_${IFVAR} >/dev/null 2>&1; then
depend_${IFVAR}
fi
local dep= prov=
for dep in need use before after provide keywords; do
eval prov=\$rc_${dep}_${IFVAR}
if [ -n "${prov}" ]; then
${dep} ${prov}
fi
done
}
# Support bash arrays - sigh