gluon-config-mode: replace foreach with get_first
This commit is contained in:
parent
cd30517ec1
commit
a4ca5a9f7d
@ -52,9 +52,7 @@ function action_reboot()
|
||||
pubkey = configmode.get_fastd_pubkey(meshvpn_name)
|
||||
end
|
||||
|
||||
uci:foreach("gluon-config-mode", "wizard", function(s)
|
||||
uci:set("gluon-config-mode", s[".name"], "configured", "1")
|
||||
end)
|
||||
uci:set("gluon-config-mode", uci:get_first("gluon-config-mode", "wizard"), "configured", "1")
|
||||
uci:save("gluon-config-mode")
|
||||
uci:commit("gluon-config-mode")
|
||||
|
||||
|
@ -97,17 +97,14 @@ function f.handle(self, state, data)
|
||||
uci:save("fastd")
|
||||
uci:commit("fastd")
|
||||
|
||||
uci:foreach("system", "system", function(s)
|
||||
uci:set("system", s[".name"], "hostname", data._hostname)
|
||||
end)
|
||||
uci:set("system", uci:get_first("system", "system"), "hostname", data._hostname)
|
||||
uci:save("system")
|
||||
uci:commit("system")
|
||||
|
||||
uci:foreach("gluon-node-info", "location", function(s)
|
||||
uci:set("gluon-node-info", s[".name"], "share_location", data._location)
|
||||
uci:set("gluon-node-info", s[".name"], "latitude", data._latitude)
|
||||
uci:set("gluon-node-info", s[".name"], "longitude", data._longitude)
|
||||
end)
|
||||
local sname = uci:get_first("gluon-node-info", "location")
|
||||
uci:set("gluon-node-info", sname, "share_location", data._location)
|
||||
uci:set("gluon-node-info", sname, "latitude", data._latitude)
|
||||
uci:set("gluon-node-info", sname, "longitude", data._longitude)
|
||||
uci:save("gluon-node-info")
|
||||
uci:commit("gluon-node-info")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user