diff options
Diffstat (limited to 'sysconfig/network-scripts')
-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 |