aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-02-16 14:05:03 -0500
committerBill Nottingham <notting@redhat.com>2010-03-01 16:03:36 -0500
commit9c4b5b4c2f2105e99377719b78631b357dfc2e3d (patch)
treef1241b3b23b7df7cf1b7031084b15c11c68cbe59
parent7f6964b636fb980e83c7b84c1b46c319d4dca780 (diff)
downloadinitscripts-9c4b5b4c2f2105e99377719b78631b357dfc2e3d.tar
initscripts-9c4b5b4c2f2105e99377719b78631b357dfc2e3d.tar.gz
initscripts-9c4b5b4c2f2105e99377719b78631b357dfc2e3d.tar.bz2
initscripts-9c4b5b4c2f2105e99377719b78631b357dfc2e3d.tar.xz
initscripts-9c4b5b4c2f2105e99377719b78631b357dfc2e3d.zip
Add get_config_by_name, use it.
-rw-r--r--sysconfig/network-scripts/network-functions12
1 files changed, 12 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index bef3606c..96df715b 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -41,6 +41,13 @@ get_config_by_subchannel ()
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
}
+get_config_by_name ()
+{
+ LANG=C grep -E -i -l \
+ "^[[:space:]]*NAME=\"(Auto |System )?${1}\"" \
+ /etc/sysconfig/network-scripts/ifcfg-* \
+ | LC_ALL=C sed -e "$__sed_discard_ignored_files"
+}
get_device_by_hwaddr ()
{
@@ -55,6 +62,11 @@ need_config ()
[ -f "${CONFIG}" ] && return
CONFIG="${1##*/}"
[ -f "${CONFIG}" ] && return
+ nconfig=$(get_config_by_name ${1})
+ if [ -n "$nconfig" ] && [ -f "$nconfig" ]; then
+ CONFIG=${nconfig##*/}
+ return
+ fi
local addr=$(get_hwaddr ${1})
if [ -n "$addr" ]; then
nconfig=$(get_config_by_hwaddr ${addr})