diff options
author | Miloslav Trmac <mitr@volny.cz> | 2006-07-26 03:38:48 +0000 |
---|---|---|
committer | Miloslav Trmac <mitr@volny.cz> | 2006-07-26 03:38:48 +0000 |
commit | d4a318ddb703bccf495c75a05af9e5376a6de46e (patch) | |
tree | 030ee585f34967c899ec64f42481e4e9827e5d46 | |
parent | ad98e4eaac64a44263fc4e79933f8c33603a9f3e (diff) | |
download | initscripts-d4a318ddb703bccf495c75a05af9e5376a6de46e.tar initscripts-d4a318ddb703bccf495c75a05af9e5376a6de46e.tar.gz initscripts-d4a318ddb703bccf495c75a05af9e5376a6de46e.tar.bz2 initscripts-d4a318ddb703bccf495c75a05af9e5376a6de46e.tar.xz initscripts-d4a318ddb703bccf495c75a05af9e5376a6de46e.zip |
Handle ifcfg files not named ifcfg-$DEVICE (based on a patch by
Michal Jaegermann <michal@harddata.com>)
Return only the basename of the ifcfg file, even if looked up by HWADDR.
-rw-r--r-- | sysconfig/network-scripts/network-functions | 12 |
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 () |