/[cwmp]/google/trunk/bin/acs.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /google/trunk/bin/acs.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 218 - (hide annotations)
Tue Nov 20 13:09:08 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: text/plain
File size: 1047 byte(s)
 r248@brr:  dpavlin | 2007-11-20 14:08:48 +0100
 cleanup dump directory on startup

1 dpavlin 28 #!/usr/bin/perl -w
2    
3     # acs.pl
4     #
5     # 06/18/07 09:19:54 CEST Dobrica Pavlinusic <dpavlin@rot13.org>
6    
7     use strict;
8    
9 dpavlin 30 use lib './lib';
10     use CWMP::Server;
11 dpavlin 203 use CWMP::Session;
12     use CWMP::Vendor;
13 dpavlin 57 use Getopt::Long;
14 dpavlin 203 use Data::Dump qw/dump/;
15 dpavlin 218 use File::Find;
16 dpavlin 28
17     my $port = 3333;
18 dpavlin 57 my $debug = 0;
19 dpavlin 164 my $store_path = './';
20     my $store_plugin = 'YAML';
21 dpavlin 205 my $create_dump = 1;
22 dpavlin 28
23 dpavlin 57 GetOptions(
24     'debug+' => \$debug,
25     'port=i' => \$port,
26 dpavlin 164 'store-path=s' => \$store_path,
27     'store-plugin=s' => \$store_plugin,
28 dpavlin 205 'create_dump!' => \$create_dump,
29 dpavlin 57 );
30    
31 dpavlin 218 if ( $create_dump ) {
32     warn "## cleaning dump directory\n" if $debug;
33     find({
34     wanted => sub {
35     my $path = $File::Find::name;
36     return if -d $path;
37     unlink($path) || die "can't remove $path: $!";
38     warn "## removed $path\n" if $debug;
39     },
40     no_chdir => 1,
41     }, 'dump/' );
42     }
43    
44 dpavlin 50 my $server = CWMP::Server->new({
45     port => $port,
46 dpavlin 205 session => {
47     store => {
48     module => $store_plugin,
49     path => $store_path,
50     debug => $debug,
51     },
52     create_dump => $create_dump,
53 dpavlin 150 },
54 dpavlin 53 debug => $debug,
55 dpavlin 50 });
56 dpavlin 203
57     CWMP::Vendor->add_triggers;
58    
59 dpavlin 28 $server->run();
60    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26