aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-routes
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2007-09-25 14:56:26 +0000
committerBill Nottingham <notting@redhat.com>2007-09-25 14:56:26 +0000
commit75698769f6b5b123d16286571f6c9c792c0351af (patch)
tree5ea2252bc5f1cb171620cfa1b4693917d7b9d414 /sysconfig/network-scripts/ifup-routes
parentc479557fc5aff54be7a44780cedede44598611d6 (diff)
downloadinitscripts-75698769f6b5b123d16286571f6c9c792c0351af.tar
initscripts-75698769f6b5b123d16286571f6c9c792c0351af.tar.gz
initscripts-75698769f6b5b123d16286571f6c9c792c0351af.tar.bz2
initscripts-75698769f6b5b123d16286571f6c9c792c0351af.tar.xz
initscripts-75698769f6b5b123d16286571f6c9c792c0351af.zip
work around bash changes (#220887, modified from <nvigier@mandriva.com>)
Diffstat (limited to 'sysconfig/network-scripts/ifup-routes')
-rwxr-xr-xsysconfig/network-scripts/ifup-routes6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup-routes b/sysconfig/network-scripts/ifup-routes
index d065aaf9..83a7adc3 100755
--- a/sysconfig/network-scripts/ifup-routes
+++ b/sysconfig/network-scripts/ifup-routes
@@ -26,6 +26,8 @@ if [ -n "$2" -a "$2" != "$1" ]; then
FILES="$FILES /etc/sysconfig/network-scripts/route-$2"
fi
+MATCH='^[[:space:]]*(\#.*)?$'
+
for file in $FILES; do
if [ -f "$file" ]; then
if egrep -q '^[[:space:]]*ADDRESS[0-9]+=' $file ; then
@@ -34,7 +36,7 @@ for file in $FILES; do
else
# older format
{ cat "$file" ; echo ; } | while read line; do
- if [[ ! "$line" =~ '^[[:space:]]*(\#.*)?$' ]]; then
+ if [[ ! "$line" =~ $MATCH ]]; then
/sbin/ip route add $line
fi
done
@@ -58,7 +60,7 @@ fi
for file in $FILES; do
if [ -f "$file" ]; then
{ cat "$file" ; echo ; } | while read line; do
- if [[ ! "$line" =~ '^[[:space:]]*(\#.*)?$' ]]; then
+ if [[ ! "$line" =~ $MATCH ]]; then
/sbin/ip rule add $line
fi
done