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>
include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3
include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3
PKG_RELEASE:=1
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>, \
Aaron Goodman <aaronjg@alumni.stanford.edu>
PKG_RELEASE:=1
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>, \
Aaron Goodman <aaronjg@alumni.stanford.edu>
config_get enabled "$iface" enabled 0
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"
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")"