mwan3: do not wait to process ifup/ifdown events
authorAaron Goodman <redacted>
Wed, 28 Oct 2020 02:09:36 +0000 (22:09 -0400)
committerAaron Goodman <redacted>
Wed, 28 Oct 2020 03:18:18 +0000 (23:18 -0400)
Signed-off-by: Aaron Goodman <redacted>
net/mwan3/files/usr/sbin/mwan3track

index b771e8fced84292f1e1b45a7263de278102a0010..d97933e09ba3378d4f2261cbeca10e43da7e5800 100755 (executable)
@@ -345,8 +345,12 @@ main() {
                get_uptime > $MWAN3TRACK_STATUS_DIR/$INTERFACE/TIME
 
                host_up_count=0
-               sleep "${sleep_time}" &
-               wait
+               if [ "${IFDOWN_EVENT}" -ne 0 ] && [ "${IFUP_EVENT}" -ne 0 ]; then
+                       sleep "${sleep_time}" &
+                       SLEEP_PID=$!
+                       wait
+                       unset SLEEP_PID
+               fi
 
                if [ "${IFDOWN_EVENT}" -eq 1 ]; then
                        LOG debug "Register ifdown event on interface ${INTERFACE} (${DEVICE})"
git clone https://git.99rst.org/PROJECT