Only issue 'done.' progress message on success

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-01-14 11:46:38 -08:00
parent 12eaf81dcc
commit 978e8e3849
4 changed files with 24 additions and 14 deletions

View File

@ -169,9 +169,11 @@ case "$COMMAND" in
detect_configuration detect_configuration
define_firewall define_firewall
status=$? status=$?
[ -n "$SUBSYSLOCK" -a $status -eq 0 ] && touch $SUBSYSLOCK if [ $status -eq 0 ]; then
[ -n "$SUBSYSLOCK" ] && touch $SUBSYSLOCK
progress_message3 "done." progress_message3 "done."
fi fi
fi
;; ;;
stop) stop)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
@ -227,7 +229,7 @@ case "$COMMAND" in
if [ -n "$SUBSYSLOCK" ]; then if [ -n "$SUBSYSLOCK" ]; then
[ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK [ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK
fi fi
progress_message3 "done." [ $status -eq 0 ] && progress_message3 "done."
;; ;;
refresh) refresh)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
@ -236,7 +238,7 @@ case "$COMMAND" in
detect_configuration detect_configuration
define_firewall define_firewall
status=$? status=$?
progress_message3 "done." [ $status -eq 0 ] && progress_message3 "done."
else else
echo "$g_product is not running" >&2 echo "$g_product is not running" >&2
status=2 status=2
@ -256,10 +258,10 @@ case "$COMMAND" in
progress_message3 "Clearing $g_product...." progress_message3 "Clearing $g_product...."
clear_firewall clear_firewall
status=0 status=0
if [ -n "$SUBSYSLOCK" ]; then if [ $status -eq 0 ]; then
rm -f $SUBSYSLOCK [ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
fi
progress_message3 "done." progress_message3 "done."
fi
;; ;;
status) status)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2

View File

@ -181,10 +181,12 @@ case "$COMMAND" in
detect_configuration detect_configuration
define_firewall define_firewall
status=$? status=$?
[ -n "$SUBSYSLOCK" -a $status -eq 0 ] && touch $SUBSYSLOCK if [ $status -eq 0 ]; then
[ -n "$SUBSYSLOCK" ] && touch $SUBSYSLOCK
progress_message3 "done." progress_message3 "done."
fi fi
fi fi
fi
;; ;;
stop) stop)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
@ -244,7 +246,8 @@ case "$COMMAND" in
if [ -n "$SUBSYSLOCK" ]; then if [ -n "$SUBSYSLOCK" ]; then
[ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK [ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK
fi fi
progress_message3 "done."
[ $status -eq 0 ] && progress_message3 "done."
fi fi
;; ;;
refresh) refresh)
@ -255,7 +258,7 @@ case "$COMMAND" in
detect_configuration detect_configuration
define_firewall define_firewall
status=$? status=$?
progress_message3 "done." [ $status -eq 0 ] && progress_message3 "done."
fi fi
else else
echo "$g_product is not running" >&2 echo "$g_product is not running" >&2
@ -271,6 +274,7 @@ case "$COMMAND" in
if [ -n "$SUBSYSLOCK" ]; then if [ -n "$SUBSYSLOCK" ]; then
[ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK [ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK
fi fi
[ $status -eq 0 ] && progress_message3 "done."
fi fi
;; ;;
clear) clear)

View File

@ -6,6 +6,8 @@ Changes in Shorewall 4.4.17 Beta 1
3) Export (param,value) pairs with EXPORTPARAMS=No. 3) Export (param,value) pairs with EXPORTPARAMS=No.
4) Only produce 'done.' progress message on success.
Changes in Shorewall 4.4.16 RC 1 Changes in Shorewall 4.4.16 RC 1
1) Fix logging for jump to nat chain. 1) Fix logging for jump to nat chain.

View File

@ -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 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 I I. K N O W N P R O B L E M S R E M A I N I N G