7 |
use Getopt::Long; |
use Getopt::Long; |
8 |
|
|
9 |
use lib './lib'; |
use lib './lib'; |
10 |
use MDAP::ChangeIP; |
use MDAP; |
11 |
|
|
12 |
my $GROUP = '224.0.0.103'; |
my $GROUP = '224.0.0.103'; |
13 |
my $PORT = '3235'; |
my $PORT = '3235'; |
17 |
my $verbose = 0; |
my $verbose = 0; |
18 |
my $credentials = 0; |
my $credentials = 0; |
19 |
|
|
20 |
|
my $plugins = 1; |
21 |
|
|
22 |
my $resend_search_delay = 3; |
my $resend_search_delay = 3; |
23 |
my $tftp_path = '/srv/tftp/'; |
my $tftp_path = '/srv/tftp/'; |
24 |
|
|
34 |
"tftp=s" => \$tftp_path, |
"tftp=s" => \$tftp_path, |
35 |
"credentials" => \$credentials, |
"credentials" => \$credentials, |
36 |
"exec=s" => \$flashed_cmd, |
"exec=s" => \$flashed_cmd, |
37 |
|
'plugins!' => \$plugins, |
38 |
); |
); |
39 |
|
|
40 |
$quiet = 0 if $verbose; |
$quiet = 0 if $verbose; |
269 |
once "!! NO FIRMWARE for $board in $tftp_path for ant $ant, skipping update\n"; |
once "!! NO FIRMWARE for $board in $tftp_path for ant $ant, skipping update\n"; |
270 |
} |
} |
271 |
|
|
272 |
if ( my $command = CWMP::ChangeIP::check( $h ) ) { |
if ( $plugins ) { |
273 |
warn "## sending $command to $ant\n"; |
foreach my $plugin ( MDAP->plugins ) { |
274 |
mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nCLI-CMD:$command\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n"); |
warn "## calling $plugin\n" if $debug; |
275 |
|
if ( my $command = $plugin->check( $h ) ) { |
276 |
|
warn "## plugin $plugin sending $command to $ant\n"; |
277 |
|
mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nCLI-CMD:$command\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n"); } |
278 |
|
} |
279 |
} |
} |
280 |
|
|
281 |
} elsif ( $type eq 'REPLY-EXEC-CLI' ) { |
} elsif ( $type eq 'REPLY-EXEC-CLI' ) { |