awall-cli 458 Bytes
Newer Older
Kaarle Ritvanen's avatar
Kaarle Ritvanen committed
1 2 3 4 5 6 7 8
#!/usr/bin/lua

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

9 10 11 12 13 14 15 16 17
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
Kaarle Ritvanen's avatar
Kaarle Ritvanen committed
18 19

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

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