diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-09-03 00:36:13 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-09-03 00:36:13 +0000 |
commit | c842b668b0ada4757aca0f7feccf041a24628b2b (patch) | |
tree | a0a514b0367121ec9ea941f9ef91a0df5f56b567 | |
parent | 15eb2bcbb0b5983160a3cd5e1b83e16c2aca71a6 (diff) |
* luci/contrib/olsrd-luci: adept config generator to new uci api and fix ifname in interface sections
-rw-r--r-- | contrib/package/olsrd-luci/files/lib/config/olsr.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/package/olsrd-luci/files/lib/config/olsr.lua b/contrib/package/olsrd-luci/files/lib/config/olsr.lua index a10837ff4..1afd9a068 100644 --- a/contrib/package/olsrd-luci/files/lib/config/olsr.lua +++ b/contrib/package/olsrd-luci/files/lib/config/olsr.lua @@ -19,7 +19,8 @@ require("luci.fs") require("luci.util") require("luci.model.uci") -local conf = luci.model.uci.get_all("olsr") +local uci = luci.model.uci.cursor() +local conf = uci:get_all("olsr") local function _value(val) if val:match("^[0-9%. \t]+$") or val == "yes" or val == "no" then @@ -34,7 +35,11 @@ local function _section(sect,sval,parstr) local pad = "" if sval then - rv = string.format( '%s "%s"\n{\n', conf[sect][".type"], conf[sect][sval] ) + if sval == "Interface" then + rv = string.format( 'Interface "%s"\n{\n', uci:get("network",conf[sect][sval],"ifname") ) + else + rv = string.format( '%s "%s"\n{\n', conf[sect][".type"], conf[sect][sval] ) + end pad = "\t" end |