/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
/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