X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=scripts%2Ftcli.pl;h=45456e3f3e75bd3b1e4a8cb93822b0ef252f54a4;hb=4c0e11c9fce3d7cdffc724ae4b3b9754edf72e82;hp=037b0d1a41ec04590bac86038caa441f844693f6;hpb=b5bf342fe1f1110abd2d17fba876afd46da8598c;p=perl-cwmp.git diff --git a/scripts/tcli.pl b/scripts/tcli.pl index 037b0d1..45456e3 100755 --- a/scripts/tcli.pl +++ b/scripts/tcli.pl @@ -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";