projects
/
perl-cwmp.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
vendor.yaml example file
[perl-cwmp.git]
/
scripts
/
zte-configure-acs.pl
1
#!/usr/bin/perl
2
3
use warnings;
4
use strict;
5
6
my $acs = 'http://192.168.2.100:3333';
7
my $cpe = 'http://192.168.2.1';
8
9
use WWW::Mechanize;
10
my $mech = WWW::Mechanize->new();
11
12
$mech->get( $cpe );
13
14
$mech->submit_form(
15
form_number => 1,
16
fields => {
17
tUsername => 'admin',
18
tPassword => 'admin',
19
}
20
);
21
22
$mech->follow_link( text_regex => qr/Advanced/ );
23
24
$mech->follow_link( text_regex => qr/TR069/ );
25
26
#$mech->dump_forms;
27
#$mech->dump_links;
28
#$mech->dump_all;
29
30
my $uid = 'time-' . time();
31
32
$mech->submit_form(
33
form_number => 2,
34
fields => {
35
_ACS_URL => $acs,
36
_ACS_NAME => $uid,
37
_ENABLE => '_ENABLE',
38
}
39
);
40
41
42
warn $uid;
43