awall-cli 469 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 22 23 24 25 26
awall.loadmodules(testmode and '.')

if testmode then
   awall.confdirs = {'json', 'input'}
   awall.iptdir = 'output'
   awall.ipsfile = 'output/ipset'
end
Kaarle Ritvanen's avatar
Kaarle Ritvanen committed
27

28 29
awall.test()
awall.dump()