Skip to content

Commit

Permalink
openwrt: update Gluon upgrade script
Browse files Browse the repository at this point in the history
  • Loading branch information
blocktrron committed Apr 9, 2024
1 parent a7d78e9 commit 1ed136e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions openwrt/node-whisperer/files/node-whisperer.upgrade.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,30 @@
local site = require 'gluon.site'
local uci = require('simple-uci').cursor()

local default_sources = {
'hostname',
'node_id',
'uptime',
'site_code',
'system_load',
'firmware_version',
}

local sources = {}
local disabled = false
local sources_set = false

if not site.node_whisperer.enabled(false) then
disabled = true
end

for _, information in ipairs(site.node_whisperer.information({})) do
table.insert(sources, information)
sources_set = true
end

if not sources_set then
sources = default_sources
end

uci:set('node-whisperer', 'settings', 'disabled', disabled)
Expand Down

0 comments on commit 1ed136e

Please sign in to comment.