#!/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
	eth*.0*)
		IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"`
		;;
	eth*.*)
		IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"`
		;;
	*)	exit 0
		;;
esac

if [ -z "$IF_VLAN_RAW_DEVICE" ]
then
	exit 0
fi
if [ ! -x /sbin/vconfig ]
then
  exit 0
fi

vconfig rem $IFACE
