From 75698769f6b5b123d16286571f6c9c792c0351af Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 25 Sep 2007 14:56:26 +0000 Subject: work around bash changes (#220887, modified from ) --- sysconfig/network-scripts/ifup-routes | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sysconfig/network-scripts/ifup-routes') 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 -- cgit v1.2.1