From 4f59c248e03af19bca6246b78a4031928b2fa97a Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 13 Sep 2023 16:14:26 +0200 Subject: [PATCH] mwan3: remove notracking in mwan3track ubus status 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 --- net/mwan3/Makefile | 2 +- net/mwan3/files/usr/libexec/rpcd/mwan3 | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/net/mwan3/Makefile b/net/mwan3/Makefile index b31f4ce342..3242189697 100644 --- a/net/mwan3/Makefile +++ b/net/mwan3/Makefile @@ -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 , \ Aaron Goodman diff --git a/net/mwan3/files/usr/libexec/rpcd/mwan3 b/net/mwan3/files/usr/libexec/rpcd/mwan3 index 3fce9b0d4d..eccd10196c 100755 --- a/net/mwan3/files/usr/libexec/rpcd/mwan3 +++ b/net/mwan3/files/usr/libexec/rpcd/mwan3 @@ -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 -- 2.30.2