summaryrefslogtreecommitdiffstats
path: root/main/bridge/bridge.pre-up
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-02-12 08:49:50 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-02-12 08:50:35 +0000
commit0e1e087322b10ded282638c8d25a62a2c1ce18e3 (patch)
tree6ce3252e5d5685db1fac6a13fbb901e426023cd1 /main/bridge/bridge.pre-up
parent7b13245abef94443d4a7e45bb6e734e243057274 (diff)
downloadaports-0e1e087322b10ded282638c8d25a62a2c1ce18e3.tar.bz2
aports-0e1e087322b10ded282638c8d25a62a2c1ce18e3.tar.xz
main/bridge: support bridges without any ports added
Useful for virtualization
Diffstat (limited to 'main/bridge/bridge.pre-up')
-rwxr-xr-xmain/bridge/bridge.pre-up5
1 files changed, 3 insertions, 2 deletions
diff --git a/main/bridge/bridge.pre-up b/main/bridge/bridge.pre-up
index 995e25888..997bb74f2 100755
--- a/main/bridge/bridge.pre-up
+++ b/main/bridge/bridge.pre-up
@@ -122,10 +122,11 @@ all) PORTS=$(all_ports);;
*) PORTS="$IF_BRIDGE_PORTS";;
esac
-[ -z "$PORTS" ] && exit
+[ -z "$PORTS" ] && ! env | grep -q "^IF_BRIDGE" && exit
+
case "$MODE" in
-start)
+start)
brctl addbr $IFACE || exit 1
wait_ports
set_bridge_opts