The code extracting VLANID and IF_VLAN_RAW_DEVICE seems overly complex IMHO. The "case" statement already ensures we operate on vlan device so I think something much simpler would work:
VLANID=`echo $IFACE|sed "s/[^.]\+\.\([0-9]\+\).*/\1/; s/^0//"` IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\([^.]\+\)\.[0-9]\+.*/\1/"`
This is also easier to read.
The code extracting VLANID and IF_VLAN_RAW_DEVICE seems overly complex IMHO. The "case" statement already ensures we operate on vlan device so I think something much simpler would work:
VLANID=`echo $IFACE|sed "s/[^.] \+\.\([ 0-9]\+\ ).*/\1/ ; s/^0//"` RAW_DEVICE= `echo $IFACE|sed "s/\([^ .]\+\)\ .[0-9]\ +.*/\1/ "`
IF_VLAN_
This is also easier to read.