summaryrefslogtreecommitdiff
path: root/package/base-files/src/etc/network/if-post-down.d
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2010-02-07 22:01:27 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2010-02-07 22:01:27 +0100
commit7de93724af9791bad0a8e887d02bf7a3a872305c (patch)
treec4de7f2ecaa01cc7cf371eb3b771a6b8a8f9a9de /package/base-files/src/etc/network/if-post-down.d
parentbd1730cdff6b88d54d5fdb3d63d5733ca33abe59 (diff)
parent254ae86e16cddf282b36c0593148e24151ce1f96 (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'package/base-files/src/etc/network/if-post-down.d')
-rwxr-xr-xpackage/base-files/src/etc/network/if-post-down.d/01-bridge26
-rwxr-xr-xpackage/base-files/src/etc/network/if-post-down.d/02-vlan10
2 files changed, 36 insertions, 0 deletions
diff --git a/package/base-files/src/etc/network/if-post-down.d/01-bridge b/package/base-files/src/etc/network/if-post-down.d/01-bridge
new file mode 100755
index 000000000..47f3c976b
--- /dev/null
+++ b/package/base-files/src/etc/network/if-post-down.d/01-bridge
@@ -0,0 +1,26 @@
+#!/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
+
+for IF in $INTERFACES; do
+ ip link set down dev $IF && brctl delif $IFACE $IF
+done
+
+ip link set down dev $IFACE || exit 1
+brctl delbr $IFACE
+exit 0
diff --git a/package/base-files/src/etc/network/if-post-down.d/02-vlan b/package/base-files/src/etc/network/if-post-down.d/02-vlan
new file mode 100755
index 000000000..e448a7641
--- /dev/null
+++ b/package/base-files/src/etc/network/if-post-down.d/02-vlan
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+[ -x /sbin/vconfig ] || exit 0
+
+[ -e /proc/net/vlan/$IFACE ] && (
+ ip link set down dev $IFACE
+ vconfig rem $IFACE
+)
+
+exit 0