From: Marcin Krol Date: Mon, 9 Sep 2019 22:46:57 +0000 (+0000) Subject: - fix regex for newer iproute2, fixes no connectivity bug X-Git-Tag: 0.5.2~2 X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=21e610d89da09c31ff36b575dea6ddb20988e1db;p=rc-scripts.git - fix regex for newer iproute2, fixes no connectivity bug --- diff --git a/lib/functions.network b/lib/functions.network index d151b04..862d42b 100644 --- a/lib/functions.network +++ b/lib/functions.network @@ -484,7 +484,7 @@ setup_ip_rules () /sbin/ip rule add $args $prio done elif is_no "$1"; then - LC_ALL=C /sbin/ip rule show | grep -vE -e "from all lookup (main|default|local|253|254|255) \$" -e " map-to " | while read prio from src args; do + LC_ALL=C /sbin/ip rule show | grep -vE -e "from all lookup (main|default|local|253|254|255)[[:space:]]*\$" -e " map-to " | while read prio from src args; do [ "$src" = "all" ] && /sbin/ip rule delete $args || /sbin/ip rule delete $from $src $args done fi @@ -503,7 +503,7 @@ setup_ip_rules () /sbin/ip -6 rule add $args $prio done elif is_no "$1"; then - LC_ALL=C /sbin/ip -6 rule show | grep -vE -e "from all lookup (main|default|local|253|254|255) \$" -e " map-to " | while read prio from src args; do + LC_ALL=C /sbin/ip -6 rule show | grep -vE -e "from all lookup (main|default|local|253|254|255)[[:space:]]*\$" -e " map-to " | while read prio from src args; do [ "$src" = "all" ] && /sbin/ip -6 rule delete $args || /sbin/ip -6 rule delete $from $src $args done fi