summaryrefslogtreecommitdiff
path: root/package/base-files/extra/etc/network
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2009-11-25 23:02:27 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2009-11-25 23:02:27 +0100
commit83f5e16fffe029232114ee9f54b8df41d5841912 (patch)
tree981c8fe3ba18133dd7b01a79e817de1961253600 /package/base-files/extra/etc/network
parent02e9bb0970ba681f228dc642b1e5026cc97047c7 (diff)
add update script to base-files
- system update via http/ftp/ssh/file possible - add bridge script - cleanup unused files
Diffstat (limited to 'package/base-files/extra/etc/network')
-rw-r--r--package/base-files/extra/etc/network/if-pre-up.d/bridge32
1 files changed, 32 insertions, 0 deletions
diff --git a/package/base-files/extra/etc/network/if-pre-up.d/bridge b/package/base-files/extra/etc/network/if-pre-up.d/bridge
new file mode 100644
index 000000000..766084de1
--- /dev/null
+++ b/package/base-files/extra/etc/network/if-pre-up.d/bridge
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+if [ ! -x /usr/sbin/brctl ]
+then
+ exit 0
+fi
+
+case "$IF_BRIDGE_PORTS" in
+ "")
+ exit 0
+ ;;
+ none)
+ INTERFACES=""
+ ;;
+ *)
+ INTERFACES="$IF_BRIDGE_PORTS"
+ ;;
+esac
+
+brctl addbr $IFACE || exit 1
+
+for IF in $INTERFACES; do
+ if ! grep -q $IF /proc/net/dev; then
+ echo "Error: interface '$IF' does not exist!"
+ brctl delbr $IFACE
+ exit 1
+ fi
+ brctl addif $IFACE $IF
+ ip link set up dev $IF
+done
+
+exit 0