aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2009-12-19 16:03:10 +0200
committerBill Nottingham <notting@redhat.com>2010-01-12 16:40:46 -0500
commitb9bef01af3a42c87f213dfa825965e146b4b8966 (patch)
treea992ed745c1e361d9fa040484d4f300e4992973c
parent43a7ec311b56f0ba6b06c3d35a53990869153ed5 (diff)
downloadinitscripts-b9bef01af3a42c87f213dfa825965e146b4b8966.tar
initscripts-b9bef01af3a42c87f213dfa825965e146b4b8966.tar.gz
initscripts-b9bef01af3a42c87f213dfa825965e146b4b8966.tar.bz2
initscripts-b9bef01af3a42c87f213dfa825965e146b4b8966.tar.xz
initscripts-b9bef01af3a42c87f213dfa825965e146b4b8966.zip
Get rid of uses of deprecated egrep and fgrep.
-rw-r--r--debug.csh2
-rwxr-xr-xrc.d/init.d/network14
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth6
-rwxr-xr-xsysconfig/network-scripts/ifup-routes2
-rw-r--r--sysconfig/network-scripts/network-functions2
5 files changed, 13 insertions, 13 deletions
diff --git a/debug.csh b/debug.csh
index a5d5df6c..bfd4735a 100644
--- a/debug.csh
+++ b/debug.csh
@@ -1,3 +1,3 @@
if ( -f /etc/sysconfig/debug ) then
- eval `egrep -v '(^[:blank:]*#|\$RANDOM)' /etc/sysconfig/debug | sed 's|^export ||g' | sed 's|\([^=]*\)=\([^=]*\)|setenv \1 \2|g' | sed 's|$|;|'`
+ eval `grep -Ev '(^[:blank:]*#|\$RANDOM)' /etc/sysconfig/debug | sed 's|^export ||g' | sed 's|\([^=]*\)=\([^=]*\)|setenv \1 \2|g' | sed 's|$|;|'`
endif
diff --git a/rc.d/init.d/network b/rc.d/init.d/network
index d8d39089..52845ae3 100755
--- a/rc.d/init.d/network
+++ b/rc.d/init.d/network
@@ -98,9 +98,9 @@ case "$1" in
# bring up all other interfaces configured to come up at boot time
for i in $interfaces; do
unset DEVICE TYPE SLAVE
- eval $(LANG=C fgrep "DEVICE=" ifcfg-$i)
- eval $(LANG=C fgrep "TYPE=" ifcfg-$i)
- eval $(LANG=C fgrep "SLAVE=" ifcfg-$i)
+ eval $(LANG=C grep -F "DEVICE=" ifcfg-$i)
+ eval $(LANG=C grep -F "TYPE=" ifcfg-$i)
+ eval $(LANG=C grep -F "SLAVE=" ifcfg-$i)
if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
@@ -131,7 +131,7 @@ case "$1" in
continue
fi
- if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i > /dev/null ; then
+ if LANG=C grep -EL "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i > /dev/null ; then
# this loads the module, to preserve ordering
is_available $i
continue
@@ -147,7 +147,7 @@ case "$1" in
# Bring up xDSL and VPN interfaces
for i in $vlaninterfaces $bridgeinterfaces $xdslinterfaces $vpninterfaces ; do
- if ! LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i >/dev/null 2>&1 ; then
+ if ! LANG=C grep -EL "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i >/dev/null 2>&1 ; then
# If we're in confirmation mode, get user confirmation.
if [ -f /var/run/confirm ]; then
confirm $i
@@ -208,8 +208,8 @@ case "$1" in
# get list of bonding, vpn, and xdsl interfaces
for i in $interfaces; do
unset DEVICE TYPE
- eval $(LANG=C fgrep "DEVICE=" ifcfg-$i)
- eval $(LANG=C fgrep "TYPE=" ifcfg-$i)
+ eval $(LANG=C grep -F "DEVICE=" ifcfg-$i)
+ eval $(LANG=C grep -F "TYPE=" ifcfg-$i)
if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index 1ca6a6f2..05d44174 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -37,7 +37,7 @@ if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then
if [ -n "${FOUNDMACADDR}" -a "${FOUNDMACADDR}" != "${HWADDR}" ]; then
NEWCONFIG=$(get_config_by_hwaddr ${FOUNDMACADDR})
if [ -n "${NEWCONFIG}" ]; then
- eval $(LANG=C fgrep "DEVICE=" $NEWCONFIG)
+ eval $(LANG=C grep -F "DEVICE=" $NEWCONFIG)
else
echo $"Device ${DEVICE} has MAC address ${FOUNDMACADDR}, instead of configured address ${HWADDR}. Ignoring."
exit 1
@@ -140,8 +140,8 @@ fi
if [ -n "$VLAN" -a -x /sbin/vconfig ]; then
# 802.1q VLAN
- if echo ${DEVICE} | LANG=C egrep -v '(:)' | LANG=C egrep -q '(eth|bond)[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' \
- || echo ${DEVICE} | LANG=C egrep -q 'vlan[0-9][0-9]?[0-9]?[0-9]?' ; then
+ if echo ${DEVICE} | LANG=C grep -Ev '(:)' | LANG=C grep -Eq '(eth|bond)[0-9][0-9]*\.[0-9][0-9]?[0-9]?[0-9]?' \
+ || echo ${DEVICE} | LANG=C grep -Eq 'vlan[0-9][0-9]?[0-9]?[0-9]?' ; then
[ -f /proc/net/vlan/${DEVICE} ] && {
/sbin/vconfig rem ${DEVICE}
}
diff --git a/sysconfig/network-scripts/ifup-routes b/sysconfig/network-scripts/ifup-routes
index 1aa7f718..db3e51ea 100755
--- a/sysconfig/network-scripts/ifup-routes
+++ b/sysconfig/network-scripts/ifup-routes
@@ -30,7 +30,7 @@ MATCH='^[[:space:]]*(\#.*)?$'
for file in $FILES; do
if [ -f "$file" ]; then
- if egrep -q '^[[:space:]]*ADDRESS[0-9]+=' $file ; then
+ if grep -Eq '^[[:space:]]*ADDRESS[0-9]+=' $file ; then
# new format
handle_file $file ${1%:*}
else
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 02009c2c..e357c0f2 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -28,7 +28,7 @@ get_config_by_hwaddr ()
get_config_by_subchannel ()
{
- LANG=C egrep -i -l \
+ LANG=C grep -E -i -l \
"^[[:space:]]*SUBCHANNELS=([0-9]\.[0-9]\.[a-f0-9]+,){0,2}${1}(,[0-9]\.[0-9]\.[a-f0-9]+){0,2}([[:space:]]+#|[[:space:]]*$)" \
/etc/sysconfig/network-scripts/ifcfg-* \
| LC_ALL=C sed -e "$__sed_discard_ignored_files"