mwan3: update ubus status for not tracked interfaces
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
parent
cbc5f0916c
commit
f1da872cd4
1 changed files with 11 additions and 8 deletions
|
@ -96,8 +96,7 @@ get_mwan3_status() {
|
||||||
local age=0
|
local age=0
|
||||||
local online=0
|
local online=0
|
||||||
local offline=0
|
local offline=0
|
||||||
local up="0"
|
local enabled time_p time_n time_u time_d status track_status up uptime
|
||||||
local enabled time_p time_n time_u time_d status track_status
|
|
||||||
|
|
||||||
if [ "${iface}" != "${iface_select}" ] && [ "${iface_select}" != "" ]; then
|
if [ "${iface}" != "${iface_select}" ] && [ "${iface_select}" != "" ]; then
|
||||||
return
|
return
|
||||||
|
@ -109,15 +108,19 @@ get_mwan3_status() {
|
||||||
online=$(get_online_time "$iface")
|
online=$(get_online_time "$iface")
|
||||||
offline=$(get_offline_time "$iface")
|
offline=$(get_offline_time "$iface")
|
||||||
|
|
||||||
local uptime="0"
|
|
||||||
|
|
||||||
config_get enabled "$iface" enabled 0
|
config_get enabled "$iface" enabled 0
|
||||||
|
|
||||||
|
if [ -d "${MWAN3_STATUS_DIR}" ]; then
|
||||||
network_get_uptime uptime "$iface"
|
network_get_uptime uptime "$iface"
|
||||||
network_is_up "$iface" && up="1"
|
network_is_up "$iface" && up="1"
|
||||||
|
|
||||||
if [ -f "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS" ]; then
|
if [ -f "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS" ]; then
|
||||||
status="$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS")"
|
status="$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS")"
|
||||||
else
|
else
|
||||||
|
status="notracking"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
uptime=0
|
||||||
|
up=0
|
||||||
status="unknown"
|
status="unknown"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue