diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-05-14 11:38:29 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-05-14 11:38:29 +0000 |
commit | 9b8a758b54ffa703067c23b36b9ca801e8cb8d90 (patch) | |
tree | 4fa6857298bd82e0312c6b5d6302f3df8fe2be3d /shorewall-model.lua | |
parent | a5375d0530f4d7f9c622a1f062cb3424eed43107 (diff) | |
download | acf-shorewall-9b8a758b54ffa703067c23b36b9ca801e8cb8d90.tar.bz2 acf-shorewall-9b8a758b54ffa703067c23b36b9ca801e8cb8d90.tar.xz |
Rebuilding the config-view-file to be more easy to use (and a bit more good looking).
git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@1117 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'shorewall-model.lua')
-rw-r--r-- | shorewall-model.lua | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/shorewall-model.lua b/shorewall-model.lua index 023ceed..92c4640 100644 --- a/shorewall-model.lua +++ b/shorewall-model.lua @@ -49,7 +49,11 @@ local function read_config(file) local output = {} for k,v in pairs(filecontent) do if not string.find ( v, "^[;#].*" ) and not (string.find (v, "^%s*$")) then - table.insert(output, v) + local details = {} + for v in string.gmatch(v, "%S+") do + table.insert(details, v) + end + table.insert(output, details) end end return output @@ -213,8 +217,11 @@ function getconfig() name = "params", label="List of parameters", type="select", - option=read_config("params"), + option={}, }) + for k,v in pairs(read_config("params")) do + table.insert(config.params.option, v[1]) + end config.params.size=#config.params.option + 1 config.interfaces = cfe({ @@ -223,7 +230,6 @@ function getconfig() type="select", option=read_config("interfaces"), }) - config.interfaces.size=#config.interfaces.option + 1 config.zones = cfe({ name = "zones", @@ -231,7 +237,6 @@ function getconfig() type="select", option=read_config("zones"), }) - config.zones.size=#config.zones.option + 1 config.policy = cfe({ name = "policy", @@ -239,7 +244,6 @@ function getconfig() type="select", option=read_config("policy"), }) - config.policy.size=#config.policy.option + 1 config.rules = cfe({ name = "rules", @@ -247,7 +251,6 @@ function getconfig() type="select", option=read_config("rules"), }) - config.rules.size=#config.rules.option + 1 return config |