aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-01-22 15:36:22 -0500
committerBill Nottingham <notting@redhat.com>2010-01-22 15:38:11 -0500
commit94962e935e5991853c0f5253830c9dba16146382 (patch)
treed76e873c22cd93855888d076026dc4808186c838
parentcd305c6d26b8fcf9d9cf7e1fd13ad5e0ab5d839a (diff)
downloadinitscripts-94962e935e5991853c0f5253830c9dba16146382.tar
initscripts-94962e935e5991853c0f5253830c9dba16146382.tar.gz
initscripts-94962e935e5991853c0f5253830c9dba16146382.tar.bz2
initscripts-94962e935e5991853c0f5253830c9dba16146382.tar.xz
initscripts-94962e935e5991853c0f5253830c9dba16146382.zip
If HWADDR is set and DEVICE is not, use HWADDR to determine DEVICE. (#545597)
-rw-r--r--sysconfig/network-scripts/network-functions13
1 files changed, 7 insertions, 6 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index a08b0ddb..38440e5b 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -99,6 +99,13 @@ source_config ()
DEVICETYPE="sit"
;;
esac
+ if [ -n "$HWADDR" ]; then
+ HWADDR=$(echo $HWADDR | awk '{ print toupper($0) }')
+ fi
+ if [ -n "$MACADDR" ]; then
+ MACADDR=$(echo $MACADDR | awk '{ print toupper($0) }')
+ fi
+ [ -z "$DEVICE" -a -n "$HWADDR" ] && DEVICE=$(get_device_by_hwaddr $HWADDR)
[ -z "$DEVICETYPE" ] && DEVICETYPE=$(echo ${DEVICE} | sed "s/[0-9]*$//")
[ -z "$REALDEVICE" -a -n "$PARENTDEVICE" ] && REALDEVICE=$PARENTDEVICE
[ -z "$REALDEVICE" ] && REALDEVICE=${DEVICE%%:*}
@@ -107,12 +114,6 @@ source_config ()
else
ISALIAS=no
fi
- if [ -n "$HWADDR" ]; then
- HWADDR=$(echo $HWADDR | awk '{ print toupper($0) }')
- fi
- if [ -n "$MACADDR" ]; then
- MACADDR=$(echo $MACADDR | awk '{ print toupper($0) }')
- fi
}