summaryrefslogtreecommitdiffstats
path: root/main/vlan/vlan.post-down
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-03-15 13:35:13 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-03-15 13:35:13 +0000
commit9146859d63fb9bc88018664950a7d70086ec51eb (patch)
treea03c9c4b7b0944b8042d8e9dff63370e1a023548 /main/vlan/vlan.post-down
parent36681224a041c8256f2054f62d7b075743c9c1c6 (diff)
downloadaports-9146859d63fb9bc88018664950a7d70086ec51eb.tar.bz2
aports-9146859d63fb9bc88018664950a7d70086ec51eb.tar.xz
main/vlan: move from testing
Diffstat (limited to 'main/vlan/vlan.post-down')
-rw-r--r--main/vlan/vlan.post-down27
1 files changed, 27 insertions, 0 deletions
diff --git a/main/vlan/vlan.post-down b/main/vlan/vlan.post-down
new file mode 100644
index 000000000..bf887ef14
--- /dev/null
+++ b/main/vlan/vlan.post-down
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# If IFACE is an automagic vlan interface (without the vlan-raw-device
+# parameter) then let's try to discover the magic here.. Another way would be
+# to just probe for the right device name in /proc/net/vlan
+
+case "$IFACE" in
+ *#*) exit 0 ;;
+ *:*) exit 0 ;;
+ vlan*.*) exit 0 ;;
+ vlan*) VLAN_ID="${IFACE#vlan}" NAME1=VLAN;;
+ *.*) RAW_DEVICE="${IFACE%.*}"; VLAN_ID="${IFACE##*.}" NAME1=DEV;;
+ *) [ -n "${IF_VLAN_ID}" -o -n "${IF_VLAN_RAW_DEVICE}" ] || exit 0 ;;
+esac
+
+if [ -n "$IF_VLAN_RAW_DEVICE" ]; then
+ RAW_DEVICE="$IF_VLAN_RAW_DEVICE"
+fi
+
+if [ -n "$IF_VLAN_ID" ]; then
+ VLAN_ID="$IF_VLAN_ID"
+fi
+
+if [ -n "${RAW_DEVICE}" -o -n "${VLAN_ID}" ]
+then
+ vconfig rem "${IFACE}"
+fi