mwan3: add enabled info to mwan3 ubus status
authorFlorian Eckert <fe@dev.tdt.de>
Tue, 2 Jul 2019 09:47:47 +0000 (11:47 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Thu, 4 Jul 2019 10:03:40 +0000 (12:03 +0200)
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/mwan3/files/usr/libexec/rpcd/mwan3

index fb9523ac2fbaa83a72cc7351725ecedae073c15d..fb201f4d9bf4850e21728dbca7b9a1aaa13f488e 100755 (executable)
@@ -76,7 +76,7 @@ get_mwan3_status() {
        local age=0
        local online=0
        local offline=0
-       local pid device time_p time_n time_u time_d
+       local enabled pid device time_p time_n time_u time_d
 
        network_get_device device $1
 
@@ -105,6 +105,8 @@ get_mwan3_status() {
                }
 
                local uptime="0"
+
+               config_get enabled "$iface" enabled 0
                network_get_uptime uptime "$iface"
 
                json_add_object "${iface}"
@@ -116,6 +118,7 @@ get_mwan3_status() {
                json_add_int "lost" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/LOST")"
                json_add_int "turn" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/TURN")"
                json_add_string "status" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS")"
+               json_add_boolean "enabled" "${enabled}"
                json_add_boolean "running" "${running}"
                json_add_array "track_ip"
                for file in $MWAN3TRACK_STATUS_DIR/${iface}/*; do