summaryrefslogtreecommitdiffstats
path: root/awall-cli
blob: 90953b1173a2ebe619140b42d082e4e7da50d9ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/lua

--[[
Alpine Wall
Copyright (C) 2012 Kaarle Ritvanen
Licensed under the terms of GPL2
]]--

require 'lfs'
require 'stringy'

testmode = stringy.endswith(arg[0], '/awall-cli')

if testmode then
   path = string.sub(arg[0], 1, -11)
   lfs.chdir(path)
end

require 'awall'
awall.loadmodules(testmode and '.')

config = awall.Config.new(testmode and {'json', 'input'})
config:test()
config:dump(testmode and 'output', testmode and 'output/ipset')