aboutsummaryrefslogtreecommitdiffstats
path: root/testing/vlan/vlan.post-down
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-03-08 20:32:32 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-03-08 20:32:32 +0000
commit4c79065aca5f29d9c3f4dce7623d6633eeb047a0 (patch)
tree931c5990257dbd1b7a991c1342c4320b5606812a /testing/vlan/vlan.post-down
parentd7291212f45a277c186a20eafb4b4b3dda8e3ada (diff)
downloadaports-4c79065aca5f29d9c3f4dce7623d6633eeb047a0.tar.bz2
aports-4c79065aca5f29d9c3f4dce7623d6633eeb047a0.tar.xz
testing/vlan: new aport
Scripts for configuring VLAN network interfaces http://wiki.alpinelinux.org/wiki/Vlan
Diffstat (limited to 'testing/vlan/vlan.post-down')
-rw-r--r--testing/vlan/vlan.post-down27
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/vlan/vlan.post-down b/testing/vlan/vlan.post-down
new file mode 100644
index 0000000000..bf887ef149
--- /dev/null
+++ b/testing/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