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 <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2023-09-13 16:14:26 +02:00
parent 6a8d3565f0
commit 4f59c248e0
2 changed files with 3 additions and 7 deletions

View 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>

View file

@ -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