]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
If an iface type is specified NEVER override it
authorMariusz Mazur <mmazur@axeos.com>
Tue, 10 Feb 2015 14:33:47 +0000 (15:33 +0100)
committerMariusz Mazur <mmazur@axeos.com>
Tue, 10 Feb 2015 14:33:47 +0000 (15:33 +0100)
lib/functions.network

index f873086727ccfb652f405afc467214a6980ab3e1..0543059fcbd06594d4389fd4f0fc3c6900dfe1f4 100644 (file)
@@ -182,13 +182,14 @@ setup_ip_param ()
 {
        # detect network device type (ie. dummy, eth for dummy0, eth0 ..)
        if [ -z "$DEVICETYPE" ]; then
-               DEVICETYPE=$(echo $DEVICE | awk ' { gsub(/[\.:]?[0-9]*[\.:]?[0-9]*$/,NUL); print $0 } ')
+               # If there's a dot, it's a vlan
+               if echo ${DEVICE} | LC_ALL=C grep -qE '^[a-z0-9]+\.[0-9]+$'; then
+                       DEVICETYPE=vlan
+               else
+                       DEVICETYPE=$(echo $DEVICE | awk ' { gsub(/[\.:]?[0-9]*[\.:]?[0-9]*$/,NUL); print $0 } ')
+               fi
        fi
 
-       # Setup DEVICETYPE for special cases.
-       if echo ${DEVICE} | LC_ALL=C grep -qE '^[a-z0-9]+\.[0-9]+$'; then
-               DEVICETYPE=vlan
-       fi
 
        # real name of device (ie. is eth0 for eth0,eth0:1,eth0:alias)
        SUBDEVICE=$(echo "$DEVICE" | grep -E "([0-9]+:[0-9]+)")
This page took 0.058192 seconds and 4 git commands to generate.