diff options
author | Trevor Summers Smith <trevorsummerssmith@gmail.com> | 2010-02-09 17:10:04 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2010-02-09 17:10:04 +0000 |
commit | c0f5f2122c28aa16a45fada0f95743d795be5d53 (patch) | |
tree | 7da00089d6ba39c7cea7faaa5b7b49fc6478e775 | |
parent | ecf9ef49a724f6b95039bd760893f51a920f017b (diff) |
Allow bridge interfaces to be called bridge.
-rw-r--r-- | net/bridge.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/bridge.sh b/net/bridge.sh index 6a170d46..7456a5be 100644 --- a/net/bridge.sh +++ b/net/bridge.sh @@ -11,7 +11,8 @@ _config_vars="$_config_vars bridge bridge_add brctl" _is_bridge() { - brctl show 2>/dev/null | grep -q "^${IFACE}[[:space:]]" + # Ignore header line so as to allow for bridges named 'bridge' + brctl show 2>/dev/null | sed '1,1d' | grep -q "^${IFACE}[[:space:]]" } bridge_pre_start() @@ -88,14 +89,16 @@ bridge_post_stop() if _is_bridge; then ebegin "Destroying bridge ${IFACE}" _down + # Ignore header line so as to allow for bridges named 'bridge' ports="$(brctl show 2>/dev/null | \ - sed -n -e '/^'"${IFACE}"'[[:space:]]/,/^\S/ { /^\('"${IFACE}"'[[:space:]]\|\t\)/s/^.*\t//p }')" + sed -n -e '1,1d' -e '/^'"${IFACE}"'[[:space:]]/,/^\S/ { /^\('"${IFACE}"'[[:space:]]\|\t\)/s/^.*\t//p }')" delete=true iface=${IFACE} eindent else # Work out if we're added to a bridge for removal or not - eval set -- $(brctl show 2>/dev/null | sed -e "s/'/'\\\\''/g" -e "s/$/'/g" -e "s/^/'/g") + # Ignore header line so as to allow for bridges named 'bridge' + eval set -- $(brctl show 2>/dev/null | sed -e '1,1d' -e "s/'/'\\\\''/g" -e "s/$/'/g" -e "s/^/'/g") local line= for line; do set -- ${line} |