gluon/package/gluon-node-info/luasrc/lib/gluon/upgrade/510-node-info-role

13 lines
319 B
Plaintext
Raw Normal View History

#!/usr/bin/lua
local site = require 'gluon.site'
local uci = require('simple-uci').cursor()
local config = 'gluon-node-info'
local role = uci:get(config, uci:get_first(config, 'system'), 'role')
if not role then
uci:set(config, uci:get_first(config, 'system'), 'role', site.roles.default(''))
uci:save(config)
end