hush some debugging
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 30 Oct 2007 15:18:29 +0000 (15:18 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 30 Oct 2007 15:18:29 +0000 (15:18 +0000)
git-svn-id: https://perl-cwmp.googlecode.com/svn/trunk@183 836a5e1a-633d-0410-964b-294494ad4392

scripts/tcli.pl

index 037b0d1..45456e3 100755 (executable)
@@ -10,6 +10,8 @@ die "usage: $0 [modem] commands\n" unless @ARGV;
 my $modem = '10.0.0.138';
 $modem = shift @ARGV if $#ARGV >= 1;
 
+my $debug = 0;
+
 my @commands = (
 ':system config led=flash',
 );
@@ -28,16 +30,14 @@ while(<>) {
        chomp;
        next if (/^#/ || /^\s*$/);
        my $l = $_;
-       warn "--$_--";
+       warn "--$_--" if $debug;
        $l =~ s/ask\(([^|\)]+)(?:\|([^\)]+))?\)/ask($1,$2)/eg;
-       warn "++ $l\n";
+       warn "++ $l\n" if $debug;
        push @commands, $l;
 }
 
 push @commands, ':system config led=off';
 
-my $debug = 0;
-
 warn "## connecting to $modem\n";
 
 my $telnet = new Net::Telnet( $modem ) or die "Cannot telnet to $modem: $!\n";