diff options
author | Roy Marples <roy@marples.name> | 2007-10-29 09:45:49 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-10-29 09:45:49 +0000 |
commit | e372729b8cc489af7b1b2305d6fd9c1895b9c8d4 (patch) | |
tree | 5ffa0e392d92a03bd23fe8f00aa2d6a26d41ffbb /net.Linux/bridge.sh | |
parent | 42c231d7609447cb96d98cbebdc12a197324fb99 (diff) |
Network config arrays are now split by embedded new lines instead of being evaled into space separated values. This makes it easier to read, maintain and document as discussed on gentoo-dev.
Diffstat (limited to 'net.Linux/bridge.sh')
-rw-r--r-- | net.Linux/bridge.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net.Linux/bridge.sh b/net.Linux/bridge.sh index a6913fd9..e5b1df65 100644 --- a/net.Linux/bridge.sh +++ b/net.Linux/bridge.sh @@ -13,12 +13,11 @@ _is_bridge() { } bridge_pre_start() { - local ports= brif= opts= iface="${IFACE}" e= x= - eval $(_get_array "bridge_${IFVAR}") - ports="$@" + local ports= brif= iface="${IFACE}" e= x= + local ports="$(_get_array "bridge_${IFVAR}")" + local opts="$(_get_array "brctl_${IFVAR}")" + eval brif=\$bridge_add_${IFVAR} - eval $(_get_array "brctl_${IFVAR}") - opts="$@" [ -z "${ports}" -a -z "${brif}" -a -z "${opts}" ] && return 0 [ -n "${ports}" ] && bridge_post_stop @@ -32,7 +31,7 @@ bridge_pre_start() { metric=1000 fi - if ! _is_bridge ; then + if ! _is_bridge; then ebegin "Creating bridge ${IFACE}" if ! brctl addbr "${IFACE}" ; then eend 1 @@ -40,8 +39,10 @@ bridge_pre_start() { fi fi - eval $(_get_array "brctl_${IFVAR}") - for x in "$@" ; do + local IFS=" +" + for x in ${opts}; do + unset IFS set -- ${x} x=$1 shift @@ -53,8 +54,7 @@ bridge_pre_start() { einfo "Adding ports to ${IFACE}" eindent - eval set -- ${ports} - for x in "$@" ; do + for x in ${ports}; do ebegin "${x}" ifconfig "${x}" promisc up if ! brctl addif "${IFACE}" "${x}" ; then |