diff options
author | Bill Nottingham <notting@redhat.com> | 2002-01-02 04:32:06 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2002-01-02 04:32:06 +0000 |
commit | 61b0f20f2d57fc7481d10e25ff73fd076f97d9d3 (patch) | |
tree | 48a4511b9d7df74642e2421bd234e477a35ef9f2 /sysconfig | |
parent | c2bc3edebc407d94923f19e7e41c9f9bbd0cb657 (diff) | |
download | initscripts-61b0f20f2d57fc7481d10e25ff73fd076f97d9d3.tar initscripts-61b0f20f2d57fc7481d10e25ff73fd076f97d9d3.tar.gz initscripts-61b0f20f2d57fc7481d10e25ff73fd076f97d9d3.tar.bz2 initscripts-61b0f20f2d57fc7481d10e25ff73fd076f97d9d3.tar.xz initscripts-61b0f20f2d57fc7481d10e25ff73fd076f97d9d3.zip |
revert broken code.
To set HW address, use MACADDR, not HWADDR. HWADDR is used to tie a
configuration to a particular card, even if its device name changes.
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/ifup | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index 94b7caad..8b782ed4 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -92,8 +92,21 @@ is_available ${REALDEVICE} || { fi } if [ -n "${HWADDR}" ]; then - # set the appropriate eth number - /sbin/nameif ${REALDEVICE} ${HWADDR} + FOUNDMACADDR=`LC_ALL= LANG= ip -o link show ${REALDEVICE} | \ + sed 's/.*link\/ether \([[:alnum:]:]*\).*/\1/'` + if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then + NEWCONFIG=`fgrep -l "HWADDR=${HWADDR}" /etc/sysconfig/network-scripts/ifcfg-*` + if [ -n "${NEWCONFIG}" ]; then + exec /sbin/ifup ${NEWCONFIG} + fi + NEWCONFIG=`fgrep -l "HWADDR=${HWADDR}" /etc/sysconfig/networking/default/ifcfg-*` + if [ -n "${NEWCONFIG}" ]; then + exec /sbin/ifup ${NEWCONFIG} + else + echo $"Device ${DEVICE} has different MAC address than expected, ignoring." + exit 1 + fi + fi fi # is the device wireless? If so, configure wireless device specifics |