1 |
dpavlin |
56 |
package MDAP::Commands; |
2 |
|
|
|
3 |
|
|
use strict; |
4 |
|
|
use warnings; |
5 |
|
|
|
6 |
|
|
use Module::Pluggable; |
7 |
dpavlin |
58 |
use MDAP; |
8 |
dpavlin |
56 |
|
9 |
|
|
my $commands = [ |
10 |
|
|
'service system modify name=MDAP log=enabled', |
11 |
|
|
'cwmp debug traceconfig level=1', |
12 |
|
|
'cwmp server config url=http://10.0.0.100:3333/', |
13 |
|
|
'cwmp config state=enabled mode=full periodicInform=enabled periodicInfInt=15', |
14 |
|
|
]; |
15 |
|
|
|
16 |
|
|
my $ant_command; |
17 |
|
|
|
18 |
|
|
sub check { |
19 |
|
|
my ( $self, $h ) = @_; |
20 |
|
|
|
21 |
|
|
my $serial = $h->{'_PROD_SERIAL_NBR'} || die "no serial?"; |
22 |
|
|
|
23 |
|
|
foreach my $command ( @$commands ) { |
24 |
|
|
next if $ant_command->{$serial}->{$command}++; |
25 |
|
|
return $command; |
26 |
|
|
} |
27 |
|
|
|
28 |
dpavlin |
58 |
once "OK ",__PACKAGE__," $serial all commands sent"; |
29 |
dpavlin |
56 |
return; |
30 |
|
|
} |
31 |
|
|
|
32 |
|
|
1; |