Allow rc_need to work with net scripts, and allow for loopback also.
This commit is contained in:
		@@ -559,7 +559,7 @@
 | 
				
			|||||||
#vlan_start_eth0="no"
 | 
					#vlan_start_eth0="no"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# If you do the above then you may want to depend on eth0 like so
 | 
					# 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
 | 
					# NOTE: depend functions only work in /etc/conf.d/net
 | 
				
			||||||
# and not in profile configs such as /etc/conf.d/net.foo
 | 
					# 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
 | 
					# If any of the slaves require extra configuration - for example wireless or
 | 
				
			||||||
# ppp devices - we need to depend function on the bonded interfaces
 | 
					# 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
 | 
					# If the link require extra configuration - for example wireless or
 | 
				
			||||||
# RFC 268 bridge - we need to depend on the bridge so they get
 | 
					# RFC 268 bridge - we need to depend on the bridge so they get
 | 
				
			||||||
# configured correctly.
 | 
					# 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
 | 
					#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
 | 
					#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
 | 
					# If any of the ports require extra configuration - for example wireless or
 | 
				
			||||||
# ppp devices - we need to depend on them like so.
 | 
					# 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
 | 
					# Below is an example of configuring the bridge
 | 
				
			||||||
# Consult "man brctl" for more details
 | 
					# Consult "man brctl" for more details
 | 
				
			||||||
@@ -836,7 +836,7 @@
 | 
				
			|||||||
# link_6to4="eth0"		# Interface to base it's addresses on
 | 
					# link_6to4="eth0"		# Interface to base it's addresses on
 | 
				
			||||||
# config_6to4="ip6to4"
 | 
					# config_6to4="ip6to4"
 | 
				
			||||||
# You may want to depend on eth0 like so
 | 
					# 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
 | 
					# To ensure that eth0 is configured before 6to4. Of course, the tunnel could be
 | 
				
			||||||
# any name and this also works for any configured interface.
 | 
					# 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
 | 
					# NOTE: If you're not using iproute2 then your 6to4 tunnel has to be called
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										31
									
								
								sh/net.sh
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								sh/net.sh
									
									
									
									
									
								
							@@ -21,26 +21,23 @@ depend()
 | 
				
			|||||||
	need localmount
 | 
						need localmount
 | 
				
			||||||
	after bootmisc
 | 
						after bootmisc
 | 
				
			||||||
	provide net
 | 
						provide net
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	case "${IFACE}" in
 | 
						case "${IFACE}" in
 | 
				
			||||||
		lo|lo0);;
 | 
							lo|lo0);;
 | 
				
			||||||
		*)
 | 
							*) after net.lo net.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}
 | 
					 | 
				
			||||||
			;;
 | 
					 | 
				
			||||||
	esac
 | 
						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
 | 
					# Support bash arrays - sigh
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user