aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-01-12 21:03:36 +0000
committerBill Nottingham <notting@redhat.com>2005-01-12 21:03:36 +0000
commit90f5bdd87fd86d0263e3a5f12f6e817da9d772e6 (patch)
tree1ce2b4f5f29df883000662bf07faff810831866b
parent1b0806da445a6fa2f0674303155ccff8ec1413f1 (diff)
downloadinitscripts-90f5bdd87fd86d0263e3a5f12f6e817da9d772e6.tar
initscripts-90f5bdd87fd86d0263e3a5f12f6e817da9d772e6.tar.gz
initscripts-90f5bdd87fd86d0263e3a5f12f6e817da9d772e6.tar.bz2
initscripts-90f5bdd87fd86d0263e3a5f12f6e817da9d772e6.tar.xz
initscripts-90f5bdd87fd86d0263e3a5f12f6e817da9d772e6.zip
fix various fgreps to not catch commented lines (#136531, expanded from <cww@redhat.com>)
-rwxr-xr-xsysconfig/network-scripts/ifdown2
-rwxr-xr-xsysconfig/network-scripts/ifup6
-rw-r--r--sysconfig/network-scripts/network-functions4
3 files changed, 6 insertions, 6 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index 14e34436..8d84f404 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -52,7 +52,7 @@ check_device_down ${DEVICE} && [ "$BOOTPROTO" != "dhcp" -a "$BOOTPROTO" != "boot
if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then
FOUNDMACADDR=`get_hwaddr ${REALDEVICE}`
if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then
- NEWCONFIG=`fgrep -il "HWADDR=${HWADDR}" /etc/sysconfig/network-scripts/ifcfg-*`
+ NEWCONFIG=`LANG=C grep -il "^[[:space:]]*HWADDR=${HWADDR}" /etc/sysconfig/network-scripts/ifcfg-*`
if [ -n "${NEWCONFIG}" -a "${NEWCONFIG}" != "${CONFIG}" ]; then
exec /sbin/ifdown ${NEWCONFIG}
else
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index bfb1301b..17ad0804 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -185,7 +185,7 @@ fi
if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then
/sbin/ip link set dev ${DEVICE} down
/sbin/ip link set dev ${DEVICE} up
- for device in `fgrep -l "MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
+ for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
if [ "$BOOTPROTO" = "dhcp" ]; then
/sbin/ifup ${device##*/}
fi
@@ -296,7 +296,7 @@ else
fi
# Bonding initialization part II
if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then
- for device in `fgrep -l "MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
+ for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
/sbin/ifup ${device##*/}
done
fi
@@ -369,7 +369,7 @@ fi
# Bonding initialization part II - for static, enslave the devices. For
# DHCP, remove any routes for the slaves.
if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then
- for device in `fgrep -l "MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
+ for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
if [ "$BOOTPROTO" = "dhcp" ]; then
DEV=$DEVICE
eval $(LANG=C fgrep "DEVICE=" $device)
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 64f2effd..249f224b 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -22,7 +22,7 @@ need_config ()
[ -f "${CONFIG}" ] && return
local addr=`get_hwaddr ${1}`
if [ -n "$addr" ]; then
- local nconfig=`fgrep -il "HWADDR=$addr" /etc/sysconfig/network-scripts/ifcfg-*`
+ local nconfig=`LANG=C grep -il "^[[:space:]]*HWADDR=$addr" /etc/sysconfig/network-scripts/ifcfg-*`
if [ -n "$nconfig" ] ; then
CONFIG=$nconfig
[ -f "${CONFIG}" ] && return
@@ -158,7 +158,7 @@ rename_device()
{
/sbin/nameif "$1" "$2" || {
local hw2=`get_hwaddr ${1}`
- local nconfig=`fgrep -il "HWADDR=$hw2" /etc/sysconfig/network-scripts/ifcfg-*`
+ local nconfig=`LANG=C grep -il "^[[:space:]]*HWADDR=$hw2" /etc/sysconfig/network-scripts/ifcfg-*`
local dev=
if [ -n "$nconfig" ]; then
dev=$(. $nconfig ; echo $DEVICE)