diff options
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 |