fix retrieval of ntp_period (#517)

This commit is contained in:
Steve 2022-10-11 07:14:46 -07:00 committed by GitHub
parent 8fb2869881
commit 10bedbaf48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -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);