aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-03-18 16:35:58 -0400
committerHarald Hoyer <harald@redhat.com>2011-04-19 16:12:43 +0200
commita04b1bed54880aca749e0fd4c54fa6e0045b591a (patch)
tree69629e7607b7974098970f913db9698d93704c2e
parenta6a62aba6ea8bdbeff7ec8fdfeb89c79cd18390f (diff)
downloadinitscripts-a04b1bed54880aca749e0fd4c54fa6e0045b591a.tar
initscripts-a04b1bed54880aca749e0fd4c54fa6e0045b591a.tar.gz
initscripts-a04b1bed54880aca749e0fd4c54fa6e0045b591a.tar.bz2
initscripts-a04b1bed54880aca749e0fd4c54fa6e0045b591a.tar.xz
initscripts-a04b1bed54880aca749e0fd4c54fa6e0045b591a.zip
Make sure NEWCONFIG exists before grepping for it (#390271, continued)
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth7
1 files changed, 6 insertions, 1 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index 1f60e592..f3d3c0f6 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -30,7 +30,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