mwan3: remove notracking in mwan3track ubus status
authorFlorian Eckert <fe@dev.tdt.de>
Wed, 13 Sep 2023 14:14:26 +0000 (16:14 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Wed, 20 Sep 2023 14:05:08 +0000 (16:05 +0200)
The function 'get_mwan3_status' is reading the internal state from the
tracker via the status file. Do not use the state 'notracking' status
anymore. If the mwan3track is not running always return 'unknown'
and not 'notracking'. There is already an other function that evaluates
the external state of the tracker.

We have now the following states of the tracker:
internal (mwan3track):
- offline
- online
- diconnecting
- connecting
- disabled
- unknown

external (via pgrep and config):
- paused
- active
- down
- not enabled

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/mwan3/Makefile
net/mwan3/files/usr/libexec/rpcd/mwan3

index b31f4ce34209cbc22ff8d3183c14ff38ac509e9c..324218969757e91cdf465937d7e1066cfea48873 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mwan3
-PKG_VERSION:=2.11.8
+PKG_VERSION:=2.11.9
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>, \
                Aaron Goodman <aaronjg@alumni.stanford.edu>
index 3fce9b0d4d48cf570c2fa9770b164825e31aeda5..eccd10196c3c8982a7b138c560b848cd4e65ddb8 100755 (executable)
@@ -106,14 +106,10 @@ get_mwan3_status() {
 
        config_get enabled "$iface" enabled 0
 
-       if [ -d "${MWAN3_STATUS_DIR}" ]; then
+       if [ -f "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS" ]; then
                network_get_uptime uptime "$iface"
                network_is_up "$iface" && up="1"
-               if [ -f "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS" ]; then
-                       status="$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS")"
-               else
-                       status="notracking"
-               fi
+               status="$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS")"
        else
                uptime=0
                up=0