From 2c03614af849d081b32244e82b80194c017d2c86 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Wed, 4 Apr 2012 20:56:24 +0200 Subject: [PATCH] Add "quiet" flag. --- tools/mesh/r0ket.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/mesh/r0ket.pm b/tools/mesh/r0ket.pm index 38baaab..26267b9 100755 --- a/tools/mesh/r0ket.pm +++ b/tools/mesh/r0ket.pm @@ -13,6 +13,7 @@ use Time::HiRes; our $verbose=0; our $bridge; # Open device +our $quiet=0; ### Utility sub sprint{ @@ -111,7 +112,7 @@ sub get_packet{ if($firstpkt){ $firstpkt--; }else{ - print STDERR "Unparseable stuff: <",sprint($1),">\n"; + print STDERR "Unparseable stuff: <",sprint($1),">\n" if(!$quiet); }; }elsif ($buffer =~ s/^\\2\\0//s){ return 'ack'; # In-band signalling. Evil %) @@ -128,7 +129,7 @@ sub get_packet{ sub rest{ if(length($buffer)>0){ - print "rest: <", sprint($buffer), ">\n"; + print "rest: <", sprint($buffer), ">\n" if(!$quiet); }; }; @@ -255,7 +256,7 @@ sub nice_beacon{ $out->{idx}, $out->{beacon}; if(unpack("H*",substr($pkt,12,2)) ne "ffff"){ - print "unused=",unpack("H*",substr($pkt,12,2))," "; + print "unused=",unpack("H*",substr($pkt,12,2))," " if (!$quiet); }; }elsif($type eq "\x23"){ $out->{type}= "nick";