From 0c75e888fcc71599f3a695ae54a7a0b1beb16f0f Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 30 Jan 2008 13:20:47 +0000 Subject: Allow rc_need to work with net scripts, and allow for loopback also. --- sh/net.sh | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'sh') diff --git a/sh/net.sh b/sh/net.sh index 7a304363..4b4469c9 100755 --- a/sh/net.sh +++ b/sh/net.sh @@ -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 -- cgit v1.2.3