Source code taken from cacert-20130129.tar.bz2
[cacert.git] / scripts / cleanthem.pl
1 #!/usr/bin/perl -w
2
3 my %mysqltables=("gpg"=>"gpg","client"=>"emailcerts","server"=>"domaincerts","orgclient"=>"orgemailcerts","orgserver"=>"orgdomaincerts");
4
5 sub mysql_query($)
6 {
7 $dbh->do($_[0]);
8 }
9
10 my $aktiv=1;
11
12 foreach my $dir (("../csr","../crt"))
13 {
14 my $dirhandle;
15 opendir($dirhandle,"../csr");
16 while($_=readdir($dirhandle))
17 {
18 if(! -s "$dir/$_" and -f "$dir/$_" and !-d "$dir/$_")
19 {
20 print "Loesche $dir/$_\n";
21 unlink "$dir/$_";
22 }
23 }
24 }