diff --git a/net/mwan3/files/usr/sbin/mwan3rtmon b/net/mwan3/files/usr/sbin/mwan3rtmon index afdc96d1a..f8e6ec081 100755 --- a/net/mwan3/files/usr/sbin/mwan3rtmon +++ b/net/mwan3/files/usr/sbin/mwan3rtmon @@ -23,11 +23,16 @@ main() { config_get rtmon_interval globals rtmon_interval '5' sleep 3 - while mwan3_rtmon_ipv4 || mwan3_rtmon_ipv6; do + while true; do + mwan3_lock + [ mwan3_remon_ipv4 = "1" ] || \ + [ mwan3_rtmon_ipv6 = "1" ] && break + mwan3_unlock [ "$rtmon_interval" = "0" ] && break sleep "$rtmon_interval" & wait done + mwan3_unlock } main "$@"