configure ACS server to ZTE CPE
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 8 Mar 2010 13:32:19 +0000 (13:32 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 8 Mar 2010 13:32:19 +0000 (13:32 +0000)
git-svn-id: https://perl-cwmp.googlecode.com/svn/trunk@275 836a5e1a-633d-0410-964b-294494ad4392

scripts/zte-configure-acs.pl [new file with mode: 0755]

diff --git a/scripts/zte-configure-acs.pl b/scripts/zte-configure-acs.pl
new file mode 100755 (executable)
index 0000000..65ee54a
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+my $acs = 'http://192.168.2.100:3333';
+my $cpe = 'http://192.168.2.1';
+
+use WWW::Mechanize;
+my $mech = WWW::Mechanize->new();
+
+$mech->get( $cpe );
+
+$mech->submit_form(
+       form_number => 1,
+       fields => {
+               tUsername => 'admin',
+               tPassword => 'admin',
+       }
+);
+
+$mech->follow_link( text_regex => qr/Advanced/ );
+
+$mech->follow_link( text_regex => qr/TR069/ );
+
+#$mech->dump_forms;
+#$mech->dump_links;
+#$mech->dump_all;
+
+my $uid = 'time-' . time();
+
+$mech->submit_form(
+       form_number => 2,
+       fields => {
+               _ACS_URL => $acs,
+               _ACS_NAME => $uid,
+               _ENABLE => '_ENABLE',
+       }
+);
+
+
+warn $uid;
+