aboutsummaryrefslogtreecommitdiffstats
path: root/awall-cli
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2016-07-17 17:51:21 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2016-07-17 23:50:51 +0300
commit20407dfd6bb00e9c3459a5d84720a20899c0a381 (patch)
tree6787640c14049ebfd64f3052d59d50df4157d8d5 /awall-cli
parent2f83519036b4ad3f11a29bd2ab73205e18c75525 (diff)
downloadawall-20407dfd6bb00e9c3459a5d84720a20899c0a381.tar.bz2
awall-20407dfd6bb00e9c3459a5d84720a20899c0a381.tar.xz
helper function for printing to stderr
Diffstat (limited to 'awall-cli')
-rwxr-xr-xawall-cli11
1 files changed, 6 insertions, 5 deletions
diff --git a/awall-cli b/awall-cli
index 220bc8b..e1b0cd5 100755
--- a/awall-cli
+++ b/awall-cli
@@ -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()