aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2014-06-05 16:00:59 +0200
committerLukas Nykryn <lnykryn@redhat.com>2014-09-16 13:15:52 +0200
commitf38abebcf824b8ea40a384c8b2500e162b5a7f09 (patch)
treef02472e490ea6d426003345713ded33cf395b41a /sysconfig/network-scripts
parent439ec8b6e84b44e9ea29e8b1104d0cf604ba6cd5 (diff)
downloadinitscripts-f38abebcf824b8ea40a384c8b2500e162b5a7f09.tar
initscripts-f38abebcf824b8ea40a384c8b2500e162b5a7f09.tar.gz
initscripts-f38abebcf824b8ea40a384c8b2500e162b5a7f09.tar.bz2
initscripts-f38abebcf824b8ea40a384c8b2500e162b5a7f09.tar.xz
initscripts-f38abebcf824b8ea40a384c8b2500e162b5a7f09.zip
custom naming for VLAN devices
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifup37
1 files changed, 22 insertions, 15 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 4cf292ec..d68c1d12 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -75,21 +75,28 @@ if [ "$_use_nm" = "true" -a -n "$UUID" ]; then
fi
# Ethernet 802.1Q VLAN support
-if [ "${VLAN}" = "yes" ] && [ "$ISALIAS" = "no" ]; then
- VID=""
- MATCH='^.+\.[0-9]{1,4}$'
- if [[ "${DEVICE}" =~ $MATCH ]]; then
- VID=$(echo "${DEVICE}" | LC_ALL=C sed 's/^.*\.\([0-9]\+\)/\1/')
- PHYSDEV=${DEVICE%.*}
- fi
- MATCH='^vlan[0-9]{1,4}?'
- if [[ "${DEVICE}" =~ $MATCH ]]; then
- VID=$(echo "${DEVICE}" | LC_ALL=C sed 's/^vlan0*//')
- # PHYSDEV should be set in ifcfg-vlan* file
- if test -z "$PHYSDEV"; then
- net_log $"PHYSDEV should be set for device ${DEVICE}"
- exit 1
- fi
+if [ "${VLAN}" = "yes" ] && [ "$ISALIAS" = "no" ] && [ -n $DEVICE ]; then
+ if [ -n ${VID} ]; then
+ if test -z "$PHYSDEV"; then
+ net_log $"PHYSDEV should be set for device ${DEVICE}"
+ exit 1
+ fi
+ else
+ VID=""
+ MATCH='^.+\.[0-9]{1,4}$'
+ if [[ "${DEVICE}" =~ $MATCH ]]; then
+ VID=$(echo "${DEVICE}" | LC_ALL=C sed 's/^.*\.\([0-9]\+\)/\1/')
+ PHYSDEV=${DEVICE%.*}
+ fi
+ MATCH='^vlan[0-9]{1,4}?'
+ if [[ "${DEVICE}" =~ $MATCH ]]; then
+ VID=$(echo "${DEVICE}" | LC_ALL=C sed 's/^vlan0*//'):
+ # PHYSDEV should be set in ifcfg-vlan* file
+ if test -z "$PHYSDEV"; then
+ net_log $"PHYSDEV should be set for device ${DEVICE}"
+ exit 1
+ fi
+ fi
fi
if [ -n "$VID" ]; then
if [ ! -d /proc/net/vlan ]; then