X-Git-Url: http://git.rot13.org/?p=perl-cwmp.git;a=blobdiff_plain;f=bin%2Facs.pl;h=cc1a2ad95e5d4bc5f6f725a0d2244ac0ad140b79;hp=36750881b3f927ce5630aecce7fe431f1f147337;hb=5ea6e09597af2a09a847b8973e30601811f52725;hpb=12a50bdc9389aa9a6dd5011365c11ed2091106e7 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 => {