diff options
author | Bill Nottingham <notting@redhat.com> | 2008-03-18 16:35:58 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2008-03-18 16:35:58 -0400 |
commit | 4822a7a38eb42fb77ef36c25c0eae1c85e0154ab (patch) | |
tree | 40e5eecc245309a4d17c4eab03741315cbe377e1 /sysconfig | |
parent | 6e95a2571e8f124559b131b0c74aaa4ee886963c (diff) | |
download | initscripts-4822a7a38eb42fb77ef36c25c0eae1c85e0154ab.tar initscripts-4822a7a38eb42fb77ef36c25c0eae1c85e0154ab.tar.gz initscripts-4822a7a38eb42fb77ef36c25c0eae1c85e0154ab.tar.bz2 initscripts-4822a7a38eb42fb77ef36c25c0eae1c85e0154ab.tar.xz initscripts-4822a7a38eb42fb77ef36c25c0eae1c85e0154ab.zip |
Make sure NEWCONFIG exists before grepping for it (#390271, continued)
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/ifdown-eth | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth index 7030eaca..4ddd414d 100755 --- a/sysconfig/network-scripts/ifdown-eth +++ b/sysconfig/network-scripts/ifdown-eth @@ -48,7 +48,12 @@ if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then FOUNDMACADDR=`get_hwaddr ${REALDEVICE}` if [ -n "${FOUNDMACADDR}" -a "${FOUNDMACADDR}" != "${HWADDR}" ]; then NEWCONFIG=`get_config_by_hwaddr ${FOUNDMACADDR}` - eval $(LANG=C fgrep "DEVICE=" $NEWCONFIG) + if [ -n "${NEWCONFIG}" ]; then + eval $(LANG=C fgrep "DEVICE=" $NEWCONFIG) + else + echo $"Device ${DEVICE} has MAC address ${FOUNDMACADDR}, instead of configured address ${HWADDR}. Ignoring." + exit 1 + fi if [ -n "${NEWCONFIG}" -a "${NEWCONFIG##*/}" != "${CONFIG##*/}" -a "${DEVICE}" = "${REALDEVICE}" ]; then exec /sbin/ifdown ${NEWCONFIG} else |