diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2014-06-05 16:00:59 +0200 |
---|---|---|
committer | Lukas Nykryn <lnykryn@redhat.com> | 2014-06-05 16:01:23 +0200 |
commit | 7cb06713039dcb4e581a070ce102ad408fdff2e4 (patch) | |
tree | 0d181b7c8f4e98bed678c9d531c09fe96b1a181a /sysconfig | |
parent | 82d04813e2ddbb941d94fcf4b7c27496b44a747a (diff) | |
download | initscripts-7cb06713039dcb4e581a070ce102ad408fdff2e4.tar initscripts-7cb06713039dcb4e581a070ce102ad408fdff2e4.tar.gz initscripts-7cb06713039dcb4e581a070ce102ad408fdff2e4.tar.bz2 initscripts-7cb06713039dcb4e581a070ce102ad408fdff2e4.tar.xz initscripts-7cb06713039dcb4e581a070ce102ad408fdff2e4.zip |
custom naming for VLAN devices
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/ifup | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index b2c6b52d..910b1051 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -71,21 +71,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 |