From: Chen Minqiang Date: Tue, 9 Oct 2018 12:17:18 +0000 (+0800) Subject: mwan3: rtmon: filter out linkdown routing table X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8ae288967469e3441860c471d6d02a8dfc4f92da;p=feed%2Fpackages.git mwan3: rtmon: filter out linkdown routing table Signed-off-by: Chen Minqiang --- diff --git a/net/mwan3/files/lib/mwan3/mwan3.sh b/net/mwan3/files/lib/mwan3/mwan3.sh index 541e64d248..2b92a12535 100644 --- a/net/mwan3/files/lib/mwan3/mwan3.sh +++ b/net/mwan3/files/lib/mwan3/mwan3.sh @@ -26,13 +26,13 @@ mwan3_rtmon_ipv4() local idx=0 local ret=1 mkdir -p /tmp/mwan3rtmon - ($IP4 route list table main | grep -v ^default | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv4.main + ($IP4 route list table main | grep -v "^default\|linkdown" | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv4.main while uci get mwan3.@interface[$idx] >/dev/null 2>&1 ; do idx=$((idx+1)) tid=$idx [ "$(uci get mwan3.@interface[$((idx-1))].family)" = "ipv4" ] && { if $IP4 route list table $tid | grep -q ^default; then - ($IP4 route list table $tid | grep -v ^default | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv4.$tid + ($IP4 route list table $tid | grep -v "^default\|linkdown" | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv4.$tid cat /tmp/mwan3rtmon/ipv4.$tid | grep -v -x -F -f /tmp/mwan3rtmon/ipv4.main | while read line; do $IP4 route del table $tid $line done