diff options
author | Steven Barth <steven@midlink.org> | 2008-06-06 20:45:33 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-06-06 20:45:33 +0000 |
commit | cd0fb5e44e5cb538d93024d02a14a02c00752641 (patch) | |
tree | d6188cf6d6c9ee67b4a12261c3faee545cd446aa /applications/luci-splash/root/usr | |
parent | 8644ff1eab93d067e316eee9f4b567e1bf07ccb3 (diff) |
* Removed High-Level UCI-API due to Lua compiler bugs
Diffstat (limited to 'applications/luci-splash/root/usr')
-rw-r--r-- | applications/luci-splash/root/usr/sbin/luci-splash | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/applications/luci-splash/root/usr/sbin/luci-splash b/applications/luci-splash/root/usr/sbin/luci-splash index 347bdcc65e..fc3a0c8da5 100644 --- a/applications/luci-splash/root/usr/sbin/luci-splash +++ b/applications/luci-splash/root/usr/sbin/luci-splash @@ -7,7 +7,6 @@ require("luci.model.uci") -- Init state session luci.model.uci.set_savedir(luci.model.uci.savedir_state) local uci = luci.model.uci -local cfg = uci.config function main(argv) @@ -61,9 +60,10 @@ end -- Add a lease to state and invoke add_rule function add_lease(mac) - cfg.luci_splash[""] = "lease" - cfg.luci_splash[""].mac = mac - cfg.luci_splash[""].start = os.time() + uci.section("luci_splash", "lease", nil, { + mac = mac, + start = os.time() + }) add_rule(mac) uci.save() @@ -148,9 +148,10 @@ function sync() local leases = uci.get_all("luci_splash") -- Convert leasetime to seconds - local leasetime = tonumber(cfg.luci_splash.general.leasetime) * 3600 + local leasetime = tonumber(uci.get("luci_splash", "general", "leasetime")) * 3600 -- Clean state file + uci.load("luci_splash") uci.revert("luci_splash") @@ -162,9 +163,10 @@ function sync() remove_rule(v.mac) else -- Rewrite state - cfg.luci_splash[""] = "lease" - cfg.luci_splash[""].mac = v.mac - cfg.luci_splash[""].start = v.start + uci.section("luci_splash", "lease", nil, { + mac = v.mac, + start = v.start + }) written[v.mac:lower()] = 1 end end |