mirror of https://github.com/aredn/aredn.git
fix retrieval of ntp_period (#517)
This commit is contained in:
parent
8fb2869881
commit
10bedbaf48
|
@ -560,6 +560,13 @@ if not gridsquare then
|
||||||
gridsquare = ""
|
gridsquare = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- retrieve ntp_period
|
||||||
|
local cm = uci.cursor("/etc/config.mesh")
|
||||||
|
ntp_period = cm:get("aredn", "@ntp[0]", "period")
|
||||||
|
if not ntp_period then
|
||||||
|
ntp_period = "daily"
|
||||||
|
end
|
||||||
|
|
||||||
-- validate and save configuration
|
-- validate and save configuration
|
||||||
if parms.button_save then
|
if parms.button_save then
|
||||||
for _,zone in ipairs(tz_db_names)
|
for _,zone in ipairs(tz_db_names)
|
||||||
|
@ -767,10 +774,10 @@ if parms.button_save then
|
||||||
end
|
end
|
||||||
|
|
||||||
-- commit new ntp_period value
|
-- commit new ntp_period value
|
||||||
local cursorm = uci.cursor("/etc/config.mesh")
|
local cm = uci.cursor("/etc/config.mesh")
|
||||||
if parms.ntp_period ~= cursorm:get("aredn", "@ntp[0]", "period") then
|
if parms.ntp_period ~= cm:get("aredn", "@ntp[0]", "period") then
|
||||||
cursorm:set("aredn", "@ntp[0]", "period", parms.ntp_period)
|
cm:set("aredn", "@ntp[0]", "period", parms.ntp_period)
|
||||||
cursorm:commit("aredn")
|
cm:commit("aredn")
|
||||||
end
|
end
|
||||||
|
|
||||||
aredn_info.set_nvram("node", parms.node);
|
aredn_info.set_nvram("node", parms.node);
|
||||||
|
|
Loading…
Reference in New Issue