diff options
Diffstat (limited to 'testing/vlan/vlan.post-down')
-rw-r--r-- | testing/vlan/vlan.post-down | 27 |
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 |