summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-03-27 23:51:39 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-03-27 23:51:39 +0000
commit564649cb9286ad4f24c1d5446591deb16de8965e (patch)
tree54c32704506fe52a53a5efb72d75c2c7474c6d42 /modules
parent4fa474cf2b8c0ec99366c76625e4c78c389d6cb1 (diff)
modules/admin-full: create rdate section in /e/c/system if there is none
Diffstat (limited to 'modules')
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_system/system.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_system/system.lua b/modules/admin-full/luasrc/model/cbi/admin_system/system.lua
index 9f9c92231..c55ec0497 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_system/system.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_system/system.lua
@@ -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