diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2016-07-17 17:51:21 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2016-07-17 23:50:51 +0300 |
commit | 20407dfd6bb00e9c3459a5d84720a20899c0a381 (patch) | |
tree | 6787640c14049ebfd64f3052d59d50df4157d8d5 /awall-cli | |
parent | 2f83519036b4ad3f11a29bd2ab73205e18c75525 (diff) | |
download | awall-20407dfd6bb00e9c3459a5d84720a20899c0a381.tar.bz2 awall-20407dfd6bb00e9c3459a5d84720a20899c0a381.tar.xz |
helper function for printing to stderr
Diffstat (limited to 'awall-cli')
-rwxr-xr-x | awall-cli | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -116,6 +116,7 @@ end util = require('awall.util') contains = util.contains +printmsg = util.printmsg if not contains( { @@ -283,7 +284,7 @@ if not call( elseif mode == 'diff' then if not posix.stat(dumpfile) then - io.stderr:write('Please translate or activate first\n') + printmsg('Please translate or activate first') os.exit(1) end @@ -351,15 +352,15 @@ if not call( if call(config.activate, config) then if not force then - io.stderr:write('New firewall configuration activated\n') + printmsg('New firewall configuration activated') io.stderr:write('Press RETURN to commit changes permanently: ') interrupted = not io.read() kill() if interrupted then - io.stderr:write( - '\nActivation canceled, reverting to the old configuration\n' + printmsg( + '\nActivation canceled, reverting to the old configuration' ) revert() end @@ -382,7 +383,7 @@ if not call( posix.sleep(10) - io.stderr:write('\nTimeout, reverting to the old configuration\n') + printmsg('\nTimeout, reverting to the old configuration') iptables.revert() elseif mode == 'flush' then iptables.flush() |