diff options
Diffstat (limited to 'sysconfig/network-scripts/ifup')
-rwxr-xr-x | sysconfig/network-scripts/ifup | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index 89e963dc..3553f45b 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -68,11 +68,13 @@ fi # Ethernet 802.1Q VLAN support if [ -x /sbin/vconfig -a "${VLAN}" = "yes" -a "$ISALIAS" = "no" ]; then VID="" - if [[ "${DEVICE}" =~ '^(eth|bond)[0-9]+\.[0-9]{1,4}$' ]]; then + MATCH='^(eth|bond)[0-9]+\.[0-9]{1,4}$' + if [[ "${DEVICE}" =~ $MATCH ]]; then VID=$(echo "${DEVICE}" | LC_ALL=C sed 's/^[a-z0-9]*\.0*//') PHYSDEV=${DEVICE%.*} fi - if [[ "${DEVICE}" =~ '^vlan[0-9]{1,4}?' ]]; then + 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 |