mwan3: add interface uptime netifd value to ubus mwan3 status output
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 28 Jun 2019 11:04:46 +0000 (13:04 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Thu, 4 Jul 2019 10:03:37 +0000 (12:03 +0200)
Add missing netifd uptime info to ubus status call.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/mwan3/files/usr/libexec/rpcd/mwan3

index 12a7319b57134ef37180d17b32c32c4cead37f65..fb9523ac2fbaa83a72cc7351725ecedae073c15d 100755 (executable)
@@ -104,10 +104,14 @@ get_mwan3_status() {
                        let offline=time_n-time_d
                }
 
+               local uptime="0"
+               network_get_uptime uptime "$iface"
+
                json_add_object "${iface}"
                json_add_int age "$age"
                json_add_int online "${online}"
                json_add_int offline "${offline}"
+               json_add_int uptime "${uptime}"
                json_add_int "score" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/SCORE")"
                json_add_int "lost" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/LOST")"
                json_add_int "turn" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/TURN")"