aboutsummaryrefslogtreecommitdiff
path: root/net/mwan3
diff options
context:
space:
mode:
authorAaron Goodman <aaronjg@stanford.edu>2020-11-10 08:51:47 -0500
committerAaron Goodman <aaronjg@stanford.edu>2020-11-10 08:51:47 -0500
commite405b261d6c52ceb1706a13ea2fe9a94f475d9ab (patch)
treee929c1a10956444ba4d970495950e8aa85185706 /net/mwan3
parentebfb7fb9d2737e18d09009a6ce2c10bb835c0b22 (diff)
mwan3: don't include output from TRACK_OUTUPUT in status call
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
Diffstat (limited to 'net/mwan3')
-rwxr-xr-xnet/mwan3/files/usr/libexec/rpcd/mwan318
1 files changed, 9 insertions, 9 deletions
diff --git a/net/mwan3/files/usr/libexec/rpcd/mwan3 b/net/mwan3/files/usr/libexec/rpcd/mwan3
index 7368b3be3..4b53d5979 100755
--- a/net/mwan3/files/usr/libexec/rpcd/mwan3
+++ b/net/mwan3/files/usr/libexec/rpcd/mwan3
@@ -126,16 +126,16 @@ get_mwan3_status() {
json_add_boolean "running" "${running}"
json_add_boolean "up" "${up}"
json_add_array "track_ip"
- for file in $MWAN3TRACK_STATUS_DIR/${iface}/*; do
+ for file in $MWAN3TRACK_STATUS_DIR/${iface}/TRACK_*; do
+ [ -z "${file#*/TRACK_OUTPUT}" ] && continue
+ [ -z "${file#*/TRACK_\*}" ] && continue
track="${file#*/TRACK_}"
- if [ "${track}" != "${file}" ]; then
- json_add_object
- json_add_string ip "${track}"
- json_add_string status "$(cat "${file}")"
- json_add_int latency "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/LATENCY_${track}")"
- json_add_int packetloss "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/LOSS_${track}")"
- json_close_object
- fi
+ json_add_object
+ json_add_string ip "${track}"
+ json_add_string status "$(cat "${file}")"
+ json_add_int latency "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/LATENCY_${track}")"
+ json_add_int packetloss "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/LOSS_${track}")"
+ json_close_object
done
json_close_array
json_close_object