summaryrefslogtreecommitdiffhomepage
path: root/libs/uci/luasrc/model/uci.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-06-05 19:16:38 +0000
committerSteven Barth <steven@midlink.org>2008-06-05 19:16:38 +0000
commitdd9606825da5d73883b8313f5af905ea1b2a4d7d (patch)
tree1f853ae56dd8e3051698ac6d0a38d61bf6d6997f /libs/uci/luasrc/model/uci.lua
parent75f3dbaa6136a1288fbe92d80fc127f5228f5d64 (diff)
* Merged Luci to use native UCI-library
Diffstat (limited to 'libs/uci/luasrc/model/uci.lua')
-rw-r--r--libs/uci/luasrc/model/uci.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/uci/luasrc/model/uci.lua b/libs/uci/luasrc/model/uci.lua
index 060e074c4..59a9a2c27 100644
--- a/libs/uci/luasrc/model/uci.lua
+++ b/libs/uci/luasrc/model/uci.lua
@@ -37,6 +37,11 @@ local configs_mt = {}
local sections_mt = {}
local options_mt = {}
+savedir_default = "/tmp/.uci"
+confdir_default = "/etc/config"
+
+savedir_state = "/var/state"
+
config = {}
setmetatable(config, configs_mt)
@@ -44,6 +49,9 @@ setmetatable(config, configs_mt)
function configs_mt.__index(self, key)
local node = rawget(self, key)
if not node then
+ if not uci.load(key) then
+ return nil
+ end
node = {}
node[".name"] = key
setmetatable(node, sections_mt)