aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifdown-routes
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifdown-routes')
-rwxr-xr-xsysconfig/network-scripts/ifdown-routes4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysconfig/network-scripts/ifdown-routes b/sysconfig/network-scripts/ifdown-routes
index fef0ec3b..00e592f7 100755
--- a/sysconfig/network-scripts/ifdown-routes
+++ b/sysconfig/network-scripts/ifdown-routes
@@ -9,6 +9,8 @@ fi
# The routes are actually dropped just by setting the link down, so nothing
# needs to be done
+MATCH='^[[:space:]]*(\#.*)?$'
+
# Routing rules
FILES="/etc/sysconfig/network-scripts/rule-$1"
if [ -n "$2" -a "$2" != "$1" ]; then
@@ -18,7 +20,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 del $line
fi
done