[projects/rc-scripts] Allow overriding of vlan base device name
mmazur
mmazur at pld-linux.org
Thu Jan 22 15:26:57 CET 2015
commit 8a33278df32a9c5b63ce1fa943f4a6ec991f1eb8
Author: Mariusz Mazur <mmazur at axeos.com>
Date: Thu Jan 22 15:16:17 2015 +0100
Allow overriding of vlan base device name
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 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/lib/ifup-vlan b/lib/ifup-vlan
index abf1a04..3d72d78 100755
--- a/lib/ifup-vlan
+++ b/lib/ifup-vlan
@@ -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}"
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/8a33278df32a9c5b63ce1fa943f4a6ec991f1eb8
More information about the pld-cvs-commit
mailing list