Commit c81d6fc2 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen
Browse files

util: execute function

parent 168aa5fe
Ipset file dumper for Alpine Wall
Copyright (C) 2012-2019 Kaarle Ritvanen
Copyright (C) 2012-2020 Kaarle Ritvanen
See LICENSE file for license details
local util = require('awall.util')
local lpc = require('lpc')
local IPSet = require('awall.class')()
......@@ -21,10 +20,8 @@ end
function IPSet:create()
for name, ipset in pairs(self.config) do
if lpc.wait(
'ipset', '-!', 'create', name, table.unpack(ipset.options)
if util.execute(
'ipset', '-!', 'create', name, table.unpack(ipset.options)
) ~= 0 then
util.printmsg('ipset creation failed: '
......@@ -167,4 +167,6 @@ function
return pid
function M.execute(...) return lpc.wait( end
return M
Supports Markdown
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