X-Git-Url: http://git.rot13.org/?p=perl-cwmp.git;a=blobdiff_plain;f=scripts%2Ftcli.pl;h=037b0d1a41ec04590bac86038caa441f844693f6;hp=eede562809390bd51bfcf91a3e59f98289bd7168;hb=b5bf342fe1f1110abd2d17fba876afd46da8598c;hpb=62c20794ecd1b3f97e365fe00e25fb14b9ed56c8 diff --git a/scripts/tcli.pl b/scripts/tcli.pl index eede562..037b0d1 100755 --- a/scripts/tcli.pl +++ b/scripts/tcli.pl @@ -5,15 +5,15 @@ use Expect; use Net::Telnet; use Data::Dump qw/dump/; +die "usage: $0 [modem] commands\n" unless @ARGV; + my $modem = '10.0.0.138'; -$modem = shift @ARGV if $#ARGV > 1; +$modem = shift @ARGV if $#ARGV >= 1; my @commands = ( ':system config led=flash', ); -warn "ARGV = ",dump( $ARGV ); - sub ask { my ( $prompt, $default ) = @_; warn "## ask $prompt [default]"; @@ -38,6 +38,8 @@ 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"; my $exp = Expect->exp_init($telnet); $exp->debug( $debug );