aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-01-12 21:06:09 +0000
committerBill Nottingham <notting@redhat.com>2005-01-12 21:06:09 +0000
commitfedff4b5784920363b5074bf44718977cd23600a (patch)
tree7655579bd6adc9c6797b0479984a8f83e4dc0acc
parentb14c35bfbc917647f410884b0eba010e491a7efb (diff)
downloadinitscripts-fedff4b5784920363b5074bf44718977cd23600a.tar
initscripts-fedff4b5784920363b5074bf44718977cd23600a.tar.gz
initscripts-fedff4b5784920363b5074bf44718977cd23600a.tar.bz2
initscripts-fedff4b5784920363b5074bf44718977cd23600a.tar.xz
initscripts-fedff4b5784920363b5074bf44718977cd23600a.zip
fix various fgreps to not catch commented lines (#136531, expanded from <cww@redhat.com>)
-rwxr-xr-xsysconfig/network-scripts/ifdown4
-rwxr-xr-xsysconfig/network-scripts/ifup10
2 files changed, 7 insertions, 7 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index 5fd60dd7..3b3a5359 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -53,11 +53,11 @@ if [ -n "${HWADDR}" ]; then
FOUNDMACADDR=`LC_ALL= LANG= ip -o link show ${REALDEVICE} | \
sed 's/.*link\/ether \([[:alnum:]:]*\).*/\1/'`
if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then
- NEWCONFIG=`fgrep -l "HWADDR=${HWADDR}" /etc/sysconfig/network-scripts/ifcfg-*`
+ NEWCONFIG=`LANG=C grep -l "^[[:space:]]*HWADDR=${HWADDR}" /etc/sysconfig/network-scripts/ifcfg-*`
if [ -n "${NEWCONFIG}" ]; then
exec /sbin/ifdown ${NEWCONFIG}
fi
- NEWCONFIG=`fgrep -l "HWADDR=${HWADDR}" /etc/sysconfig/networking/default/ifcfg-*`
+ NEWCONFIG=`LANG=C grep -l "^[[:space:]]*HWADDR=${HWADDR}" /etc/sysconfig/networking/default/ifcfg-*`
if [ -n "${NEWCONFIG}" ]; then
exec /sbin/ifdown ${NEWCONFIG}
else
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 251d7b3b..22cc3c64 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -97,11 +97,11 @@ if [ -n "${HWADDR}" ]; then
FOUNDMACADDR=`LC_ALL= LANG= ip -o link show ${REALDEVICE} | \
sed 's/.*link\/ether \([[:alnum:]:]*\).*/\1/'`
if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then
- NEWCONFIG=`fgrep -l "HWADDR=${HWADDR}" /etc/sysconfig/network-scripts/ifcfg-*`
+ NEWCONFIG=`LANG=C grep -l "^[[:space:]]*HWADDR=${HWADDR}" /etc/sysconfig/network-scripts/ifcfg-*`
if [ -n "${NEWCONFIG}" -a "`basename ${NEWCONFIG}`" != "${CONFIG}" ]; then
exec /sbin/ifup ${NEWCONFIG}
fi
- NEWCONFIG=`fgrep -l "HWADDR=${HWADDR}" /etc/sysconfig/networking/default/ifcfg-*`
+ NEWCONFIG=`LANG=C grep -l "^[[:space:]]*HWADDR=${HWADDR}" /etc/sysconfig/networking/default/ifcfg-*`
if [ -n "${NEWCONFIG}" -a "`basename ${NEWCONFIG}`" != "${CONFIG}" ]; then
exec /sbin/ifup ${NEWCONFIG}
else
@@ -130,7 +130,7 @@ fi
if [ "${TYPE}" = "Bonding" -o "$DEVICETYPE" = "bond" ] || 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
@@ -207,7 +207,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
@@ -282,7 +282,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)