From 36bda7223dab26915b7bca098f11bf180ed8e541 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 16 Mar 2009 16:23:27 -0400 Subject: Handle full paths in need_config/source_config by normalizing them (#483257) This broke when we fixed the source commands for bash 4. It's not as having configurations outside of /etc/sysconfig/network-scripts was supported, so just normalize any full path passed in to look there. --- sysconfig/network-scripts/network-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sysconfig') diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 8c720598..628cae47 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -45,7 +45,7 @@ need_config () CONFIG="ifcfg-${1}" [ -f "${CONFIG}" ] && return - CONFIG="${1}" + CONFIG="${1##*/}" [ -f "${CONFIG}" ] && return local addr=`get_hwaddr ${1}` if [ -n "$addr" ]; then @@ -66,7 +66,8 @@ need_config () source_config () { - DEVNAME=`basename $CONFIG | sed 's/^ifcfg-//g'` + CONFIG=${CONFIG##*/} + DEVNAME=${CONFIG##ifcfg-} . ./$CONFIG [ -r "keys-$DEVNAME" ] && . ./keys-$DEVNAME case "$TYPE" in -- cgit v1.2.1