some more source re-org
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 26 Oct 2007 15:54:15 +0000 (15:54 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 26 Oct 2007 15:54:15 +0000 (15:54 +0000)
git-svn-id: https://perl-cwmp.googlecode.com/svn/trunk@119 836a5e1a-633d-0410-964b-294494ad4392

scripts/tcli.pl [new file with mode: 0755]
scripts/thompson-cwmp.txt [new file with mode: 0644]

diff --git a/scripts/tcli.pl b/scripts/tcli.pl
new file mode 100755 (executable)
index 0000000..162a4b4
--- /dev/null
@@ -0,0 +1,44 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Expect;
+use Net::Telnet;
+
+my $modem = '192.168.1.254';
+my @commands = (
+':system config led=flash',
+);
+
+while(<>) {
+       chomp;
+       next if (/^#/ || /^\s*$/);
+       push @commands, $_;
+}
+
+push @commands, ':system config led=off';
+
+my $debug = 0;
+
+my $telnet = new Net::Telnet( $modem ) or die "Cannot telnet to $modem: $!\n";
+my $exp = Expect->exp_init($telnet);
+$exp->debug( $debug );
+
+$exp->log_stdout( 1 );
+
+my ( $username, $password ) = ('Administrator','');
+my $timeout = 3;
+
+$exp->expect($timeout, 'Username : ');
+$exp->send("$username\r\n");
+$exp->expect($timeout, 'Password :');
+$exp->send("$password\r\n");
+$exp->expect($timeout, '=>');
+
+foreach my $cmd ( @commands ) {
+       $exp->send( "$cmd\r\n" );
+       $exp->expect($timeout, '=>');
+}
+
+$exp->send( "exit\r\n" );
+$exp->soft_close();
+
diff --git a/scripts/thompson-cwmp.txt b/scripts/thompson-cwmp.txt
new file mode 100644 (file)
index 0000000..02d7736
--- /dev/null
@@ -0,0 +1,7 @@
+# just a comment
+:cwmp config state=disabled
+:cwmp debug traceconfig level=1
+:cwmp server config url=http://192.168.1.90:3333/
+:cwmp config state=enabled mode=full periodicInform=enabled periodicInfInt=15
+
+