/[mdap]/lib/MDAP/Commands.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /lib/MDAP/Commands.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 56 - (show annotations)
Fri Nov 16 18:06:27 2007 UTC (16 years, 5 months ago) by dpavlin
File size: 893 byte(s)
 r74@brr:  dpavlin | 2007-11-16 19:06:22 +0100
 execute sequence of commands on each CPE

1 package MDAP::Commands;
2
3 use strict;
4 use warnings;
5
6 use Module::Pluggable;
7 use Data::Dump qw/dump/;
8
9 my $debug = 0;
10 my $verbose = 1;
11
12 my $commands = [
13 'service system modify name=MDAP log=enabled',
14 'cwmp debug traceconfig level=1',
15 'cwmp server config url=http://10.0.0.100:3333/',
16 'cwmp config state=enabled mode=full periodicInform=enabled periodicInfInt=15',
17 ];
18
19 my $ant_command;
20
21 sub check {
22 my ( $self, $h ) = @_;
23 warn "## ",__PACKAGE__,"check(",dump($h),")" if $debug;
24
25 my $serial = $h->{'_PROD_SERIAL_NBR'} || die "no serial?";
26
27 foreach my $command ( @$commands ) {
28 next if $ant_command->{$serial}->{$command}++;
29
30 warn "## sending command $command to $serial ",
31 $h->{'_VARIANT_FRIENDLY_NAME'}, " ",
32 $h->{'_BOARD_NAME'}, " ",
33 $h->{'_BUILD'},
34 "\n" if $verbose;
35
36 return $command;
37 }
38
39 warn "OK ",__PACKAGE__," $serial all commands sent\n" if $verbose;
40 return;
41 }
42
43 1;

  ViewVC Help
Powered by ViewVC 1.1.26