📄 exportcrr
字号:
## OpenCA - RA Server Command## (c) 1998-2001 by Massimiliano Pala and OpenCA Group#### File Name: exportCRR## Brief: Exports CRRs## Description: Exports Certificate Revokation Requests (needs updating)## Parameters: if ( $cmd !~ /exportCRR/i ) { configError( "Wrong Command Usage ($cmd/exportCRR)!" ); exit 1;}if( "$cmd" eq "exportCRR" ) { ## GNU Tar suggested for exporting Certification Request ## to the CA. We use the GNU tar because of its availability ## for all the platforms and its stability. print $query->start_html(-title=>"Revokation Requests Exporting Page", -BGCOLOR=>"#FFFFFF"); ## Get required parameters from the configuration file my $cmd = getRequired( 'CreateArchive' ); my $test = getRequired( 'TestArchive' ); my $dev = getRequired( 'ExportDev' ); my $dir = getRequired( 'RevReqDir' ); my $bak = getRequired( 'ExportBackup' ); ## Subtitute $orig and $dest $cmd = $query->subVar( $cmd, '$dest', $dev ); $test = $query->subVar( $test, '$dest', $dev ); print "<FONT SIZE=+3><CENTER>"; print "Please Wait, exporting Certificate Requests....<BR>\n"; print "Following fully detailed LOG...\n"; print "<HR WIDTH=80%>"; print "</CENTER></FONT>"; print "<FONT SIZE=+1><UL><OL><FONT FACE=\"Arial, Helvetica\">\n"; print "Certificate Exporting .... "; $ret = `cd $dir; $cmd . 2>&1`; if( $ret =~ /error/i ) { print "<BR><BR>Archiving Failed on $dev!<BR><BR>\n"; print "<UL><TT><FONT SIZE=-1 COLOR=red>"; print "<PRE>$ret</PRE></FONT></TT></UL>\n"; print "</OL></UL>\n"; closePage(); exit; } print "Ok.<BR>\n"; print "<UL><TT><FONT SIZE=-1 COLOR=#445567>"; print "<PRE>$ret</PRE></FONT></TT></UL>\n"; print "Testing Created Archive ... "; $ret = `$test 2>&1`; if( $ret =~ /error/i ) { print "<BR><BR>Check Failed on $dev!<BR><BR>\n"; closePage(); exit; } else { print "Ok.<BR>"; } print "<UL><TT><FONT SIZE=-1 COLOR=#445567><PRE>"; print "$ret</PRE></FONT></TT></UL>\n"; my $bakFile = setFileName( $ENV{'SSL_CLIENT_S_DN_CN'} ) . ".tar"; print "Creating Backup Archive .... "; $cmd = getRequired( 'CreateArchive' ); $cmd = $query->subVar( $cmd, '$dest', $bak . "/" . $bakFile ); $ret = `cd $dir; $cmd . 2>&1`; if( $ret =~ /error/i ) { print "<BR><BR>Archiving Failed on<BR>$bak/$bakFile!<BR><BR>\n"; print "<UL><TT><FONT SIZE=-1 COLOR=red>"; print "<PRE>$ret</PRE></FONT></TT></UL>\n"; print "</OL></UL>\n"; closePage(); exit; } print "Ok.<BR>\n"; print "<UL><TT><FONT SIZE=-1 COLOR=#445567>"; print "<PRE>$ret</PRE></FONT></TT></UL>\n"; print "Deleting Approved Requests .... "; ## Now Let's Open the Directory opendir ( REQ , "$dir" ) || die "Directory NOT found $dir!\n"; @reqList = grep(/req/, readdir( REQ ) ); closedir( REQ ); print "<UL><TT><FONT SIZE=-1 COLOR=#445567><PRE>"; foreach $file ( @reqList ) { unlink( "$dir/$file" ); print "Deleted $file\n"; } print "</PRE></FONT></TT></UL>\n"; print "</OL></UL>\n"; closePage(); exit 0;}1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -