diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-25 13:42:54 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-25 13:42:54 +0000 |
commit | 103e532246f60ae9f3368fc3be454695ad21cd6e (patch) | |
tree | 0ffda0f2f337a71ef3fe310dfc387e95bca67348 /modules/admin-full/luasrc/model/cbi | |
parent | 3b4292d9971dd216281b9cfe02899f999f862ac4 (diff) |
modules/admin-full: apply timezone immediately (#103)
Diffstat (limited to 'modules/admin-full/luasrc/model/cbi')
-rw-r--r-- | modules/admin-full/luasrc/model/cbi/admin_system/system.lua | 5 |
1 files changed, 4 insertions, 1 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 1d6163a083..a2bbf29b67 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_system/system.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_system/system.lua @@ -15,6 +15,7 @@ $Id$ require("luci.sys") require("luci.sys.zoneinfo") require("luci.tools.webadmin") +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.")) @@ -72,7 +73,9 @@ function tz.write(self, section, value) end AbstractValue.write(self, section, value) - self.map.uci:set("system", section, "timezone", lookup_zone(value) or "GMT0") + local timezone = lookup_zone(value) or "GMT0" + self.map.uci:set("system", section, "timezone", timezone) + luci.fs.writefile("/etc/TZ", timezone .. "\n") end s:option(Value, "log_size", nil, "kiB").optional = true |