diff options
author | Bill Nottingham <notting@redhat.com> | 2005-05-25 16:21:08 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2005-05-25 16:21:08 +0000 |
commit | 2251d2bc0f100d99d8ca73a392c52130dac66b65 (patch) | |
tree | f76f487d946ff57c8552b083783d93fc905ad173 | |
parent | 65897fbfb01c9e6a4dbe201e89f62bd8765c34fc (diff) | |
download | initscripts-2251d2bc0f100d99d8ca73a392c52130dac66b65.tar initscripts-2251d2bc0f100d99d8ca73a392c52130dac66b65.tar.gz initscripts-2251d2bc0f100d99d8ca73a392c52130dac66b65.tar.bz2 initscripts-2251d2bc0f100d99d8ca73a392c52130dac66b65.tar.xz initscripts-2251d2bc0f100d99d8ca73a392c52130dac66b65.zip |
fix interface renaming (#158774)
-rwxr-xr-x | sysconfig/network-scripts/ifup-eth | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index 63b1e1e3..1e712b2d 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -39,12 +39,14 @@ is_available ${REALDEVICE} # bail out, if the MAC does not fit if [ -n "${HWADDR}" ]; then FOUNDMACADDR=`get_hwaddr ${REALDEVICE}` - if [ -n "${FOUNDMACADDR}" -a "${FOUNDMACADDR}" != "${HWADDR}" ]; then + if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then curdev=`ip -o link | awk -F ':' -vIGNORECASE=1 "/$HWADDR/ { print \\$2 }"` - [ -n "$curdev" ] && rename_device "${REALDEVICE}" "${HWADDR}" "${curdev}" || { + if [ -n "$curdev" ]; then + rename_device "${REALDEVICE}" "${HWADDR}" "${curdev}" || { echo $"Device ${DEVICE} has different MAC address than expected, ignoring." exit 1 - } + } + fi fi fi |