Skip to content
Snippets Groups Projects
Commit 59616e8d authored by Jan-Philipp Litza's avatar Jan-Philipp Litza
Browse files

alfred: improved readability

parent e901ceda
No related branches found
No related tags found
No related merge requests found
...@@ -19,23 +19,27 @@ set -e ...@@ -19,23 +19,27 @@ set -e
json_init json_init
json_add_string "name" "$(uci get 'system.@system[0].hostname')" json_add_string "name" "$(uci get 'system.@system[0].hostname')"
if [ "$(uci -q get 'system.@system[0].share_location')" = 1 ]; then if [ "$(uci -q get 'system.@system[0].share_location')" = 1 ]; then
json_add_object "location" json_add_object "location"
json_add_double "latitude" "$(uci get 'system.@system[0].latitude')" json_add_double "latitude" "$(uci get 'system.@system[0].latitude')"
json_add_double "longitude" "$(uci get 'system.@system[0].longitude')" json_add_double "longitude" "$(uci get 'system.@system[0].longitude')"
json_close_object # location json_close_object # location
fi fi
json_add_object "software" json_add_object "software"
json_add_object "firmware" json_add_object "firmware"
json_add_string "base" "gluon" json_add_string "base" "gluon"
json_add_string "release" "$(cat /lib/gluon/release)" json_add_string "release" "$(cat /lib/gluon/release)"
json_close_object # firmware json_close_object # firmware
if [ -x /usr/sbin/autoupdater ]; then if [ -x /usr/sbin/autoupdater ]; then
json_add_object "autoupdater" json_add_object "autoupdater"
json_add_string "branch" "$(uci -q get autoupdater.settings.branch)" json_add_string "branch" "$(uci -q get autoupdater.settings.branch)"
json_add_boolean "enabled" "$(uci -q get autoupdater.settings.enabled)" json_add_boolean "enabled" "$(uci -q get autoupdater.settings.enabled)"
json_close_object # autoupdater json_close_object # autoupdater
fi fi
if [ -x /usr/bin/fastd ]; then if [ -x /usr/bin/fastd ]; then
json_add_object "fastd" json_add_object "fastd"
json_add_string "version" "$(fastd -v | cut -d' ' -f2)" json_add_string "version" "$(fastd -v | cut -d' ' -f2)"
...@@ -43,9 +47,11 @@ json_add_object "software" ...@@ -43,9 +47,11 @@ json_add_object "software"
json_close_object # fastd json_close_object # fastd
fi fi
json_close_object # software json_close_object # software
json_add_object "hardware" json_add_object "hardware"
json_add_string "model" "$(get_model)" json_add_string "model" "$(get_model)"
json_close_object # hardware json_close_object # hardware
json_add_object "network" json_add_object "network"
json_add_string "mac" "$(sysconfig primary_mac)" json_add_string "mac" "$(sysconfig primary_mac)"
json_add_array "addresses" json_add_array "addresses"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment