From 978e8e3849bdcb059b49cfe7ad2f645e5f3480c6 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 14 Jan 2011 11:46:38 -0800 Subject: [PATCH] Only issue 'done.' progress message on success Signed-off-by: Tom Eastep --- Shorewall/Perl/prog.footer | 20 +++++++++++--------- Shorewall/Perl/prog.footer6 | 12 ++++++++---- Shorewall/changelog.txt | 2 ++ Shorewall/releasenotes.txt | 4 +++- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Shorewall/Perl/prog.footer b/Shorewall/Perl/prog.footer index a614147ac..7dd772331 100644 --- a/Shorewall/Perl/prog.footer +++ b/Shorewall/Perl/prog.footer @@ -169,8 +169,10 @@ case "$COMMAND" in detect_configuration define_firewall status=$? - [ -n "$SUBSYSLOCK" -a $status -eq 0 ] && touch $SUBSYSLOCK - progress_message3 "done." + if [ $status -eq 0 ]; then + [ -n "$SUBSYSLOCK" ] && touch $SUBSYSLOCK + progress_message3 "done." + fi fi ;; stop) @@ -225,9 +227,9 @@ case "$COMMAND" in define_firewall status=$? if [ -n "$SUBSYSLOCK" ]; then - [ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK - fi - progress_message3 "done." + [ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK + fi + [ $status -eq 0 ] && progress_message3 "done." ;; refresh) [ $# -ne 1 ] && usage 2 @@ -236,7 +238,7 @@ case "$COMMAND" in detect_configuration define_firewall status=$? - progress_message3 "done." + [ $status -eq 0 ] && progress_message3 "done." else echo "$g_product is not running" >&2 status=2 @@ -256,10 +258,10 @@ case "$COMMAND" in progress_message3 "Clearing $g_product...." clear_firewall status=0 - if [ -n "$SUBSYSLOCK" ]; then - rm -f $SUBSYSLOCK + if [ $status -eq 0 ]; then + [ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK + progress_message3 "done." fi - progress_message3 "done." ;; status) [ $# -ne 1 ] && usage 2 diff --git a/Shorewall/Perl/prog.footer6 b/Shorewall/Perl/prog.footer6 index a1a0a7b2c..15c69fda3 100644 --- a/Shorewall/Perl/prog.footer6 +++ b/Shorewall/Perl/prog.footer6 @@ -181,8 +181,10 @@ case "$COMMAND" in detect_configuration define_firewall status=$? - [ -n "$SUBSYSLOCK" -a $status -eq 0 ] && touch $SUBSYSLOCK - progress_message3 "done." + if [ $status -eq 0 ]; then + [ -n "$SUBSYSLOCK" ] && touch $SUBSYSLOCK + progress_message3 "done." + fi fi fi ;; @@ -244,7 +246,8 @@ case "$COMMAND" in if [ -n "$SUBSYSLOCK" ]; then [ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK fi - progress_message3 "done." + + [ $status -eq 0 ] && progress_message3 "done." fi ;; refresh) @@ -255,7 +258,7 @@ case "$COMMAND" in detect_configuration define_firewall status=$? - progress_message3 "done." + [ $status -eq 0 ] && progress_message3 "done." fi else echo "$g_product is not running" >&2 @@ -271,6 +274,7 @@ case "$COMMAND" in if [ -n "$SUBSYSLOCK" ]; then [ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK fi + [ $status -eq 0 ] && progress_message3 "done." fi ;; clear) diff --git a/Shorewall/changelog.txt b/Shorewall/changelog.txt index c9bb281ea..8b3bdf027 100644 --- a/Shorewall/changelog.txt +++ b/Shorewall/changelog.txt @@ -6,6 +6,8 @@ Changes in Shorewall 4.4.17 Beta 1 3) Export (param,value) pairs with EXPORTPARAMS=No. +4) Only produce 'done.' progress message on success. + Changes in Shorewall 4.4.16 RC 1 1) Fix logging for jump to nat chain. diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index 41de60708..6817848ff 100644 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -14,7 +14,9 @@ VI. PROBLEMS CORRECTED AND NEW FEATURES IN PRIOR RELEASES I. P R O B L E M S C O R R E C T E D I N T H I S R E L E A S E ---------------------------------------------------------------------------- -None. +1) Previously, a 'done.' message could be printed at the end of + command processing even when the command had failed. Now, such a + message only appears if the command completed successfully. ---------------------------------------------------------------------------- I I. K N O W N P R O B L E M S R E M A I N I N G