Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
alpine
awall
Commits
c81d6fc2
Commit
c81d6fc2
authored
Dec 24, 2019
by
Kaarle Ritvanen
Browse files
util: execute function
parent
168aa5fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
awall/ipset.lua
View file @
c81d6fc2
--[[
Ipset file dumper for Alpine Wall
Copyright (C) 2012-20
19
Kaarle Ritvanen
Copyright (C) 2012-20
20
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
(
util
.
run
(
'ipset'
,
'-!'
,
'create'
,
name
,
table.unpack
(
ipset
.
options
)
)
if
util
.
execute
(
'ipset'
,
'-!'
,
'create'
,
name
,
table.unpack
(
ipset
.
options
)
)
~=
0
then
util
.
printmsg
(
'ipset creation failed: '
..
name
)
end
...
...
awall/util.lua
View file @
c81d6fc2
...
...
@@ -167,4 +167,6 @@ function M.run(...)
return
pid
end
function
M
.
execute
(
...
)
return
lpc
.
wait
(
M
.
run
(
...
))
end
return
M
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment