aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorMiloslav Trmac <mitr@volny.cz>2006-07-27 02:17:03 +0000
committerMiloslav Trmac <mitr@volny.cz>2006-07-27 02:17:03 +0000
commit3db5ad738151d27001658d570bce0c61648fc2cc (patch)
treefcb9a69ac7f3896e0636f929fd87f13828c51852 /sysconfig
parent02315ee166c1625d9524a783a1ad49383a4623db (diff)
downloadinitscripts-3db5ad738151d27001658d570bce0c61648fc2cc.tar
initscripts-3db5ad738151d27001658d570bce0c61648fc2cc.tar.gz
initscripts-3db5ad738151d27001658d570bce0c61648fc2cc.tar.bz2
initscripts-3db5ad738151d27001658d570bce0c61648fc2cc.tar.xz
initscripts-3db5ad738151d27001658d570bce0c61648fc2cc.zip
Consistently exclude backup files when globbing
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifup-aliases7
-rwxr-xr-xsysconfig/network-scripts/ifup-eth13
-rw-r--r--sysconfig/network-scripts/network-functions8
3 files changed, 18 insertions, 10 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
index c5a9f840..7d0acc35 100755
--- a/sysconfig/network-scripts/ifup-aliases
+++ b/sysconfig/network-scripts/ifup-aliases
@@ -317,7 +317,8 @@ function new_interface ()
if [ "$BASH_VERSINFO" ]; then shopt -s nullglob; else allow_null_glob_expansion=foo; fi
-for FILE in ifcfg-${parent_device}:*[^~] ; do
+for FILE in ifcfg-${parent_device}:* ; do
+ is_ignored_file "$FILE" && continue
ini_env;
. $FILE;
[ -z "$DEVICE" ] && DEVICE=${FILE##ifcfg-}
@@ -325,8 +326,8 @@ for FILE in ifcfg-${parent_device}:*[^~] ; do
unset DEVICE
done
-for FILE in ifcfg-${parent_device}-range*[^~] ; do
-
+for FILE in ifcfg-${parent_device}-range* ; do
+ is_ignored_file "$FILE" && continue
ini_env;
. $FILE;
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index 586c565e..e36691a2 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -118,11 +118,12 @@ if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver
/sbin/ip link set dev ${DEVICE} down
/sbin/ip link set dev ${DEVICE} up
[ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
- for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
- if [ "$BOOTPROTO" = "dhcp" ]; then
- /sbin/ifup ${device##*/}
- fi
- done
+ if [ "$BOOTPROTO" = "dhcp" ]; then
+ for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
+ is_ignored_file "$device" && continue
+ /sbin/ifup ${device##*/}
+ done
+ fi
fi
# this isn't the same as the MAC in the configuration filename. It is
@@ -200,6 +201,7 @@ else
# Bonding initialization part II
if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then
for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
+ is_ignored_file "$device" && continue
/sbin/ifup ${device##*/}
done
fi
@@ -276,6 +278,7 @@ fi
# DHCP, remove any routes for the slaves.
if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then
for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
+ is_ignored_file "$device" && continue
if [ "$BOOTPROTO" = "dhcp" ]; then
DEV=$DEVICE
(. $device
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 3a333147..ca2d802a 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -7,6 +7,8 @@
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
export PATH
+[ -z "$__sed_discard_ignored_files" ] && . /etc/init.d/functions
+
get_hwaddr ()
{
if [ -f /sys/class/net/${1}/address ]; then
@@ -20,7 +22,8 @@ get_hwaddr ()
get_config_by_hwaddr ()
{
- LANG=C grep -il "^[[:space:]]*HWADDR=${1}\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-*
+ LANG=C grep -il "^[[:space:]]*HWADDR=${1}\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-* \
+ | LC_ALL=C sed -e "$__sed_discard_ignored_files"
}
get_device_by_hwaddr ()
@@ -45,7 +48,8 @@ need_config ()
fi
fi
nconfig=$(LANG=C grep -l "^[[:space:]]*DEVICE=${1}\([[:space:]#]\|$\)" \
- /etc/sysconfig/network-scripts/ifcfg-*)
+ /etc/sysconfig/network-scripts/ifcfg-* \
+ | LC_ALL=C sed -e "$__sed_discard_ignored_files")
if [ -n "$nconfig" -a -f "$nconfig" ]; then
CONFIG=${nconfig##*/}
return