diff options
author | Florian Eckert <fe@dev.tdt.de> | 2021-05-03 10:52:26 +0200 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2021-05-03 10:52:26 +0200 |
commit | f1da872cd47b1602dc3014d6b4ee40cd5f9fe855 (patch) | |
tree | 6ee45e6744ea74eb12a6273d6cc0bb5475752258 /net/mwan3/files | |
parent | cbc5f0916c3fc6c29ef76a3e0c6c6adf0c2ccb8e (diff) |
mwan3: update ubus status for not tracked interfaces
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'net/mwan3/files')
-rwxr-xr-x | net/mwan3/files/usr/libexec/rpcd/mwan3 | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/net/mwan3/files/usr/libexec/rpcd/mwan3 b/net/mwan3/files/usr/libexec/rpcd/mwan3 index d4e7adb6f..4c71fa18f 100755 --- a/net/mwan3/files/usr/libexec/rpcd/mwan3 +++ b/net/mwan3/files/usr/libexec/rpcd/mwan3 @@ -96,8 +96,7 @@ get_mwan3_status() { local age=0 local online=0 local offline=0 - local up="0" - local enabled time_p time_n time_u time_d status track_status + local enabled time_p time_n time_u time_d status track_status up uptime if [ "${iface}" != "${iface_select}" ] && [ "${iface_select}" != "" ]; then return @@ -109,15 +108,19 @@ get_mwan3_status() { online=$(get_online_time "$iface") offline=$(get_offline_time "$iface") - local uptime="0" - config_get enabled "$iface" enabled 0 - 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")" + if [ -d "${MWAN3_STATUS_DIR}" ]; 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 else + uptime=0 + up=0 status="unknown" fi |