diff --git a/package/gluon-alfred/files/lib/gluon/alfred/announce.d/software/firmware b/package/gluon-alfred/files/lib/gluon/alfred/announce.d/software/firmware index 0a1ec310..cf50f79f 100644 --- a/package/gluon-alfred/files/lib/gluon/alfred/announce.d/software/firmware +++ b/package/gluon-alfred/files/lib/gluon/alfred/announce.d/software/firmware @@ -1,4 +1,4 @@ -return - { base = 'gluon-' .. util.trim(fs.readfile('/lib/gluon/gluon-version')) - , release = util.trim(fs.readfile('/lib/gluon/release')) - } +return { + base = 'gluon-' .. util.trim(fs.readfile('/lib/gluon/gluon-version')), + release = util.trim(fs.readfile('/lib/gluon/release')), +} diff --git a/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/idletime b/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/idletime index 93165f05..845de268 100644 --- a/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/idletime +++ b/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/idletime @@ -1 +1 @@ -return tonumber(util.trim(util.exec("cut -d' ' -f2 /proc/uptime"))) +return tonumber(fs.readfile('/proc/uptime'):match('^[^ ]+ ([^ ]+)')) diff --git a/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/loadavg b/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/loadavg index dce5d440..d79973aa 100644 --- a/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/loadavg +++ b/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/loadavg @@ -1 +1 @@ -return tonumber(util.trim(util.exec("cut -d' ' -f1 /proc/loadavg"))) +return tonumber(fs.readfile('/proc/loadavg'):match('^([^ ]+) ')) diff --git a/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/uptime b/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/uptime index 2fd6e301..0bc45bea 100644 --- a/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/uptime +++ b/package/gluon-alfred/files/lib/gluon/alfred/announce.d/statistics/uptime @@ -1 +1 @@ -return tonumber(util.trim(util.exec("cut -d' ' -f1 /proc/uptime"))) +return tonumber(fs.readfile('/proc/uptime'):match('^([^ ]+) ')) diff --git a/package/gluon-autoupdater/files/lib/gluon/alfred/announce.d/software/autoupdater b/package/gluon-autoupdater/files/lib/gluon/alfred/announce.d/software/autoupdater index 7745d1a2..75a67578 100644 --- a/package/gluon-autoupdater/files/lib/gluon/alfred/announce.d/software/autoupdater +++ b/package/gluon-autoupdater/files/lib/gluon/alfred/announce.d/software/autoupdater @@ -1,7 +1,7 @@ local autoupdater = uci:get_all('autoupdater', 'settings') if autoupdater then - return - { branch = autoupdater['branch'] - , enabled = uci:get_bool('autoupdater', 'settings', 'enabled') - } + return { + branch = autoupdater['branch'], + enabled = uci:get_bool('autoupdater', 'settings', 'enabled'), + } end diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/alfred/announce.d/software/batman-adv b/package/gluon-mesh-batman-adv/files/lib/gluon/alfred/announce.d/software/batman-adv index 4af75985..2c8390d6 100644 --- a/package/gluon-mesh-batman-adv/files/lib/gluon/alfred/announce.d/software/batman-adv +++ b/package/gluon-mesh-batman-adv/files/lib/gluon/alfred/announce.d/software/batman-adv @@ -1,3 +1,3 @@ -local version = util.exec('batctl -v'):match('%[batman%-adv: ([^%]]+)%]') +local version = util.trim(fs.readfile('/sys/module/batman_adv/version')) return { version = version } diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/alfred/announce.d/statistics/traffic b/package/gluon-mesh-batman-adv/files/lib/gluon/alfred/announce.d/statistics/traffic index 7667e4f5..378125e5 100644 --- a/package/gluon-mesh-batman-adv/files/lib/gluon/alfred/announce.d/statistics/traffic +++ b/package/gluon-mesh-batman-adv/files/lib/gluon/alfred/announce.d/statistics/traffic @@ -7,10 +7,10 @@ end local traffic = {} for _, class in ipairs({'rx', 'tx', 'forward', 'mgmt_rx', 'mgmt_tx'}) do - traffic[class] = - { bytes = fields[class .. '_bytes'] - , packets = fields[class] - } + traffic[class] = { + bytes = fields[class .. '_bytes'], + packets = fields[class], + } end traffic['tx']['dropped'] = fields['tx_dropped'] diff --git a/package/gluon-mesh-vpn-fastd/files/lib/gluon/alfred/announce.d/software/fastd b/package/gluon-mesh-vpn-fastd/files/lib/gluon/alfred/announce.d/software/fastd index 6abbbbc7..bbfbda08 100644 --- a/package/gluon-mesh-vpn-fastd/files/lib/gluon/alfred/announce.d/software/fastd +++ b/package/gluon-mesh-vpn-fastd/files/lib/gluon/alfred/announce.d/software/fastd @@ -1,4 +1,4 @@ -return - { enabled = uci:get_bool('fastd', 'mesh_vpn', 'enabled') - , version = util.trim(util.exec("fastd -v | cut -d' ' -f2")) - } +return { + enabled = uci:get_bool('fastd', 'mesh_vpn', 'enabled'), + version = util.exec('fastd -v'):match('^[^%s]+%s+([^\n]+)'), +} diff --git a/package/gluon-node-info/files/lib/gluon/alfred/announce.d/location b/package/gluon-node-info/files/lib/gluon/alfred/announce.d/location index 3060210c..eb9b3a9a 100644 --- a/package/gluon-node-info/files/lib/gluon/alfred/announce.d/location +++ b/package/gluon-node-info/files/lib/gluon/alfred/announce.d/location @@ -1,6 +1,6 @@ if uci:get_first('gluon-node-info', 'location', 'share_location', false) then - return - { latitude = tonumber(uci:get_first('gluon-node-info', 'location', 'latitude')) - , longitude = tonumber(uci:get_first('gluon-node-info', 'location', 'longitude')) - } + return { + latitude = tonumber(uci:get_first('gluon-node-info', 'location', 'latitude')), + longitude = tonumber(uci:get_first('gluon-node-info', 'location', 'longitude')), + } end