gluon/package/gluon-node-info/luasrc/lib/gluon/upgrade/510-node-info-role
Matthias Schiffer ee6afaced9
treewide: use new gluon.site Lua library
Some files have received some additional refactoring.
2017-08-11 22:07:34 +02:00

13 lines
319 B
Lua
Executable File

#!/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