diff options
-rwxr-xr-x | awall-cli | 30 |
1 files changed, 16 insertions, 14 deletions
@@ -202,6 +202,22 @@ if not call( end + local iptables = require('awall.iptables') + + if mode == 'fallback' then + + for _, sig in ipairs{'HUP', 'INT', 'PIPE'} do + signal(posix['SIG'..sig], 'SIG_IGN') + end + + posix.sleep(10) + + printmsg('\nTimeout, reverting to the old configuration') + iptables.revert() + os.exit() + end + + local input = policyset:load() if mode == 'dump' then level = 0 + (arg[opind] or 0) end @@ -284,9 +300,6 @@ if not call( local dumpfile = outputdir and outputdir..'/dump' or sysdumpfile - local iptables = require('awall.iptables') - - if mode == 'dump' then dump(level) elseif mode == 'diff' then @@ -384,17 +397,6 @@ if not call( end - elseif mode == 'fallback' then - - for _, sig in ipairs{'HUP', 'INT', 'PIPE'} do - signal(posix['SIG'..sig], 'SIG_IGN') - end - - posix.sleep(10) - - printmsg('\nTimeout, reverting to the old configuration') - iptables.revert() - elseif mode == 'flush' then iptables.flush() else assert(false) end |