mwan3: reset score to up+down on connected
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 4 May 2023 11:10:38 +0000 (13:10 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Mon, 8 May 2023 07:55:10 +0000 (09:55 +0200)
Set the score value to the maximum value when the connected function is
called. The same happens with a disconnected event, the score value is
there set to zero.

Suggested-by: Anna Tikhomirova <vamp@vampik.ru>
Suggested-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 5f0461be8b149aeb5732481d38c9d69650996f8c)

net/mwan3/files/usr/sbin/mwan3track

index c1a455b2e8eee9405f115a962c7d20349312bcf4..162bdbb7d5599312a43d9b7a03e2ec9519787ba2 100755 (executable)
@@ -128,6 +128,7 @@ connected() {
        echo "online" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/STATUS
        echo "0" > $MWAN3TRACK_STATUS_DIR/$INTERFACE/OFFLINE
        get_uptime > $MWAN3TRACK_STATUS_DIR/$INTERFACE/ONLINE
+       score=$((down+up))
        host_up_count=0
        lost=0
        turn=0