aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig')
-rw-r--r--sysconfig/network-scripts/network-functions12
1 files changed, 10 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 733215a1..bfa4b184 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -30,18 +30,26 @@ get_device_by_hwaddr ()
need_config ()
{
+ local nconfig
+
CONFIG="ifcfg-${1}"
[ -f "${CONFIG}" ] && return
CONFIG="${1}"
[ -f "${CONFIG}" ] && return
local addr=`get_hwaddr ${1}`
if [ -n "$addr" ]; then
- local nconfig=`get_config_by_hwaddr ${addr}`
+ nconfig=`get_config_by_hwaddr ${addr}`
if [ -n "$nconfig" ] ; then
- CONFIG=$nconfig
+ CONFIG=${nconfig##*/}
[ -f "${CONFIG}" ] && return
fi
fi
+ nconfig=$(LANG=C grep -l "^[[:space:]]*DEVICE=${1}\([[:space:]#]\|$\)" \
+ /etc/sysconfig/network-scripts/ifcfg-*)
+ if [ -n "$nconfig" -a -f "$nconfig" ]; then
+ CONFIG=${nconfig##*/}
+ return
+ fi
}
source_config ()