]> git.proxmox.com Git - pve-manager.git/blob - vlan-down
add eol notice
[pve-manager.git] / vlan-down
1 #!/bin/sh
2
3 # If IFACE is an automagic vlan interface (without the vlan-raw-device
4 # parameter) then let's try to discover the magic here.. Another way would be
5 # to just probe for the right device name in /proc/net/vlan
6
7 case "$IFACE" in
8 # Ignore any alias (#272891)
9 *:*)
10 exit 0
11 ;;
12 *.[0-9]*)
13 # Silently ignore interfaces which ifupdown handles on its own
14 # If IF_BRIDGE_PORTS is set, probably we're called by bridge-utils
15 [ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ] && exit 0
16 IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\([A-Za-z0-9]*\)\..*/\1/"`
17 ;;
18 # Test for vlan raw device (#196890, #292648)
19 *)
20 [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0
21 ;;
22 esac
23
24 if [ -e "/sys/class/net/$IFACE" ]; then
25 ip link delete $IFACE
26 fi