modules/admin-full: create rdate section in /e/c/system if there is none

This commit is contained in:
Jo-Philipp Wich 2010-03-27 23:51:39 +00:00
parent 4fa474cf2b
commit 564649cb92

View file

@ -19,6 +19,22 @@ require("luci.fs")
m = Map("system", translate("System"), translate("Here you can configure the basic aspects of your device like its hostname or the timezone."))
function m.on_parse()
local has_rdate = false
m.uci:foreach("system", "rdate",
function()
has_rdate = true
return false
end)
if not has_rdate then
m.uci:section("system", "rdate", nil, { })
m.uci:save("system")
end
end
s = m:section(TypedSection, "system", "")
s.anonymous = true
s.addremove = false