From 9de40c87dd6daa8d1e1727094e12b86406cc7948 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 10 May 2005 18:50:02 +0000 Subject: fix grep to always match the full hwaddr, as opposed to matching '0' against '00:AA:BB:CC:DD:EE'. Take into account lines that end with spaces, or with "# this is a comment", too. Also, put the grep in only one place instead of 3. Fixes #157252, #153669. --- sysconfig/network-scripts/ifdown-eth | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysconfig/network-scripts/ifdown-eth') diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth index 3ad86125..b7c1e770 100755 --- a/sysconfig/network-scripts/ifdown-eth +++ b/sysconfig/network-scripts/ifdown-eth @@ -37,7 +37,7 @@ check_device_down ${DEVICE} && [ "$BOOTPROTO" != "dhcp" -a "$BOOTPROTO" != "boot if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then FOUNDMACADDR=`get_hwaddr ${REALDEVICE}` if [ -n "${FOUNDMACADDR}" -a "${FOUNDMACADDR}" != "${HWADDR}" ]; then - NEWCONFIG=`LANG=C grep -il "^[[:space:]]*HWADDR=${HWADDR}" /etc/sysconfig/network-scripts/ifcfg-*` + NEWCONFIG=`get_config_by_hwaddr ${FOUNDMACADDR}` if [ -n "${NEWCONFIG}" -a "${NEWCONFIG##*/}" != "${CONFIG##*/}" ]; then exec /sbin/ifdown ${NEWCONFIG} else -- cgit v1.2.1