From e31e930825b2e1d122460b42d1a52d1aa8c13f5f Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 22 Nov 2007 13:25:20 +0000 Subject: Support FreeBSD ifconfig_foo --- net.BSD/ifconfig.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/net.BSD/ifconfig.sh b/net.BSD/ifconfig.sh index dee85f3d..5b32f4b2 100644 --- a/net.BSD/ifconfig.sh +++ b/net.BSD/ifconfig.sh @@ -190,4 +190,36 @@ _has_carrier() { [ -z "${s}" -o "${s}" = "active" -o "${s}" = "associated" ] } +ifconfig_pre_start() { + local config="$(_get_array "ifconfig_${IFVAR}")" conf= arg= args= + local IFS="$__IFS" + + [ -z "${config}" ] && return 0 + + veinfo "Running ifconfig commands" + eindent + for conf in ${config}; do + unset IFS + args= + for arg in ${conf}; do + case ${arg} in + [Dd][Hh][Cc][Pp]) ;; + [Nn][Oo][Aa][Uu][Tt][Oo]) ;; + [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;; + [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;; + [Ww][Pp][Aa]) ;; + *) args="${args} ${arg}";; + esac + done + + [ -z "${args}" ] && continue + vebegin "ifconfig${args}" + eval ifconfig "${IFACE}" "${args}" + veend $? + done + eoutdent + + return 0 +} + # vim: set ts=4 : -- cgit v1.2.3