Commit 47de4ee4 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen
Browse files

allow for non-existent ipset configuration fragment

parent 45b25882
......@@ -120,13 +120,15 @@ function translate()
awall.iptables.dump(testmode and 'output' or '/etc/iptables')
ipsfile = io.output(testmode and 'output/ipset' or '/etc/ipset.d/awall')
for name, params in pairs(config.ipset) do
if not params.type then error('Type not defined for set '..name) end
local line = 'create '..name..' '..params.type
if params.family then line = line..' family '..params.family end
ipsfile:write(line..'\n')
if config.ipset then
ipsfile = io.output(testmode and 'output/ipset' or '/etc/ipset.d/awall')
for name, params in pairs(config.ipset) do
if not params.type then error('Type not defined for set '..name) end
local line = 'create '..name..' '..params.type
if params.family then line = line..' family '..params.family end
ipsfile:write(line..'\n')
end
ipsfile:close()
end
ipsfile:close()
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment