From: Dobrica Pavlinusic Date: Mon, 8 Mar 2010 14:00:50 +0000 (+0100) Subject: Merge branch 'master' of ssh://git.rot13.org/git/perl-cwmp X-Git-Url: http://git.rot13.org/?p=perl-cwmp.git;a=commitdiff_plain;h=4d3738bffb48b2357c4df6d2e25af7bc6e05935f;hp=154531e14a8fdafceb312dc3eec3eff1ed5676a9 Merge branch 'master' of ssh://git.rot13.org/git/perl-cwmp --- diff --git a/lib/CWMP/Session.pm b/lib/CWMP/Session.pm index ab65e4d..4ce8a07 100644 --- a/lib/CWMP/Session.pm +++ b/lib/CWMP/Session.pm @@ -79,7 +79,7 @@ sub vendor_hook { my @refresh; foreach my $n ( keys %$vendor_data ) { - if ( $vendor_data->{$n} ne $stored->{$n} ) { + if ( defined $stored->{$n} && $vendor_data->{$n} ne $stored->{$n} ) { next if $set_tried->{$uid}->{$n}++; push @refresh, $n; $queue->enqueue( 'SetParameterValues', { $n => $vendor_data->{$n} } ); diff --git a/scripts/zte-configure-acs.pl b/scripts/zte-configure-acs.pl new file mode 100755 index 0000000..65ee54a --- /dev/null +++ b/scripts/zte-configure-acs.pl @@ -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; +