Commit 788f8229 authored by Vitaly Lipatov's avatar Vitaly Lipatov

route-update.sh: fix route count in hash-match check for multipath

Use grep '^[^[:space:]]' instead of wc -l for consistent counting when routes have multipath nexthop lines (3 lines per route). Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 0b135bf0
......@@ -295,7 +295,7 @@ process_routes()
if [ "$current_hash" = "$saved_hash" ] ; then
# Check if rules/routes were lost (e.g. after network restart)
local rule_count=$($ipcmd -N rule show | grep -c "lookup $table")
local route_count=$($ipcmd route show table "$table" 2>/dev/null | wc -l)
local route_count=$($ipcmd route show table "$table" 2>/dev/null | grep -c '^[^[:space:]]')
vlog "[$name]$label hash match, checking state: rules=$rule_count routes=$route_count"
if [ "$rule_count" = "0" ] ; then
need_reload=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment