X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=bin%2Facs.pl;h=cc1a2ad95e5d4bc5f6f725a0d2244ac0ad140b79;hb=6da00009ad2408e0d5f496ce0601e537b01c954a;hp=36750881b3f927ce5630aecce7fe431f1f147337;hpb=12a50bdc9389aa9a6dd5011365c11ed2091106e7;p=perl-cwmp.git diff --git a/bin/acs.pl b/bin/acs.pl index 3675088..cc1a2ad 100755 --- a/bin/acs.pl +++ b/bin/acs.pl @@ -12,6 +12,9 @@ use CWMP::Session; use CWMP::Vendor; use Getopt::Long; use Data::Dump qw/dump/; +use File::Find; + +#use Devel::LeakTrace::Fast; my $port = 3333; my $debug = 0; @@ -27,6 +30,19 @@ GetOptions( 'create_dump!' => \$create_dump, ); +if ( $create_dump ) { + warn "## cleaning dump directory\n" if $debug; + find({ + wanted => sub { + my $path = $File::Find::name; + return if -d $path; + unlink($path) || die "can't remove $path: $!"; + warn "## removed $path\n" if $debug; + }, + no_chdir => 1, + }, 'dump/' ); +} + my $server = CWMP::Server->new({ port => $port, session => {