aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2009-03-16 16:23:27 -0400
committerBill Nottingham <notting@redhat.com>2009-03-16 16:23:27 -0400
commit36bda7223dab26915b7bca098f11bf180ed8e541 (patch)
tree5756a63e841900bf0f38df2861b53497cc9e8576
parent664082738721597fabf15a2ec4a54732b0db494f (diff)
downloadinitscripts-36bda7223dab26915b7bca098f11bf180ed8e541.tar
initscripts-36bda7223dab26915b7bca098f11bf180ed8e541.tar.gz
initscripts-36bda7223dab26915b7bca098f11bf180ed8e541.tar.bz2
initscripts-36bda7223dab26915b7bca098f11bf180ed8e541.tar.xz
initscripts-36bda7223dab26915b7bca098f11bf180ed8e541.zip
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.
-rw-r--r--sysconfig/network-scripts/network-functions5
1 files changed, 3 insertions, 2 deletions
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