]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Allow overriding of vlan base device name
authorMariusz Mazur <mmazur@axeos.com>
Thu, 22 Jan 2015 14:16:17 +0000 (15:16 +0100)
committerMariusz Mazur <mmazur@axeos.com>
Thu, 22 Jan 2015 14:16:17 +0000 (15:16 +0100)
Now it's possible to, say, call all your vlan interfaces vlan.1, vlan.2,
vlan.N (or lan.X, pub.Y) regardless of the name of the physical
interface handling a given vlan.

lib/ifup-vlan

index abf1a046de27229101879693b4d30fd1d465cec8..3d72d7859c3d00c34e47da77319e223b854c9ca9 100755 (executable)
@@ -36,8 +36,10 @@ if [ "foo$2" = "fooboot" ] && is_no "${ONBOOT}"; then
        exit 0
 fi
 
-VLAN_DEV=$(echo ${DEVICE} | awk ' { gsub(/\..*$/,NUL); print $0 } ')
-VLAN_ID=$(echo ${DEVICE} | awk " { gsub(/${VLAN_DEV}\./,NUL); print \$0 } ")
+if [ -z "$VLAN_DEV" ]; then
+       VLAN_DEV=$(echo ${DEVICE} | awk ' { gsub(/\..*$/,NUL); print $0 } ')
+fi
+VLAN_ID=$(echo ${DEVICE} | awk " { gsub(/^.*\./,NUL); print \$0 } ")
 
 if [ ! -f /etc/sysconfig/interfaces/ifcfg-${VLAN_DEV} ]; then
        nls "%s is missing. Can't continue." "ifcfg-${VLAN_DEV}"
This page took 0.29627 seconds and 4 git commands to generate.