6cf03bab37
We also make use of the boolean support of simple-uci to make scripts clearer.
19 lines
403 B
Lua
Executable File
19 lines
403 B
Lua
Executable File
#!/usr/bin/lua
|
|
|
|
local site = require 'gluon.site_config'
|
|
local uci = require('simple-uci').cursor()
|
|
|
|
local config = 'gluon-node-info'
|
|
local role = uci:get(config, uci:get_first(config, 'system'), 'role')
|
|
|
|
if site.roles then
|
|
default_role = site.roles.default
|
|
else
|
|
default_role = ''
|
|
end
|
|
|
|
if not role then
|
|
uci:set(config, uci:get_first(config, 'system'), 'role', default_role)
|
|
uci:save(config)
|
|
end
|