On 08/13/2013 12:51 AM, Igor Sverkos wrote:
> Hi,
> 
> it seems like every command is honoring the "-v" option, for example
> calling "shorewall -v-1 {check,compile,restart,stop,clear,start}" will
> be silent, no output.
> 
> But "shorewall -v-1 status" will always output something. Isn't that
> inconsistent?
> 

In general, the informational commands (show, status) always produce
output. Attached is a patch that suppresses output from the status
command when the effective verbosity is <= 0.

-Tom
-- 
Tom Eastep        \ When I die, I want to go like my Grandfather who
Shoreline,         \ died peacefully in his sleep. Not screaming like
Washington, USA     \ all of the passengers in his car
http://shorewall.net \________________________________________________
diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli
index f5cc717..68d9177 100644
--- a/Shorewall-core/lib.cli
+++ b/Shorewall-core/lib.cli
@@ -2881,10 +2881,10 @@ report_capabilities1() {
 
 show_status() {
     if product_is_started ; then
-	echo "$g_product is running"
+	[ $VERBOSITY -ge 1 ] && echo "$g_product is running"
 	status=0
     else
-	echo "$g_product is stopped"
+	[ $VERBOSITY -ge 1 ] && echo "$g_product is stopped"
 	status=4
     fi
 
@@ -2898,14 +2898,13 @@ show_status() {
     else
 	state=Unknown
     fi
-    echo "State:$state"
+    [ $VERBOSITY -ge 1 ] && echo "State:$state"
 }
 
 status_command() {
-    echo "${g_product}-$SHOREWALL_VERSION Status at $g_hostname - $(date)"
-    echo
+    [ $VERBOSITY -ge 1 ] && echo "${g_product}-$SHOREWALL_VERSION Status at $g_hostname - $(date)" && echo
     show_status
-    echo
+    [ $VERBOSITY -ge 1 ] && echo
     exit $status
 }
 

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to