From 086efed4285859364c2e68a99505e4139bdc836f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 19 Jan 2014 21:29:21 +0100 Subject: [PATCH] gluon-alfred: add chosen gateway and load average --- package/gluon-alfred/files/lib/gluon/alfred/announce.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/gluon-alfred/files/lib/gluon/alfred/announce.sh b/package/gluon-alfred/files/lib/gluon/alfred/announce.sh index ba17f323..65e4b187 100755 --- a/package/gluon-alfred/files/lib/gluon/alfred/announce.sh +++ b/package/gluon-alfred/files/lib/gluon/alfred/announce.sh @@ -60,10 +60,14 @@ json_add_object "network" json_add_string "" "$addr" done json_close_array # adresses + + GATEWAY="$(batctl -m bat0 gateways | awk '/^=>/ { print $2 }')" + [ -z "$GATEWAY" ] || json_add_string "gateway" "$GATEWAY" json_close_object # network json_add_object "statistics" json_add_int "uptime" "$(cut -d' ' -f1 /proc/uptime)" + json_add_double "loadavg" "$(cut -d' ' -f1 /proc/loadavg)" json_add_object "traffic" TRAFFIC="$(ethtool -S bat0 | sed -e 's/^ *//')" for class in rx tx forward mgmt_rx mgmt_tx; do