]> git.pld-linux.org Git - packages/certificates.git/blob - cert-split
- splits ca-bundle.crt from mod_ssl into separate certificates
[packages/certificates.git] / cert-split
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 my $buf="";
6 my $crt="";
7 my $in=0;
8
9 while(<STDIN>) {
10         next if /^#/;
11         if(/^=+$/) {
12                 if($in) {
13                         print CRT $crt;
14                         close CRT;
15                         $buf=~s|/|-|g;
16                         $buf=~s|\n||;
17                         open CRT,">$buf.crt";
18                         $buf="";
19                         $crt="";
20                 } else {
21                         $buf=~s|/|-|g;
22                         $buf=~s|\n||;
23                         open CRT,">$buf.crt";
24                         $buf="";
25                         $in=1;
26                 }
27         } else {
28                 $crt.=$buf;
29                 $buf=$_;
30         }
31 }
32 print CRT $crt.$buf;
33 close CRT;
This page took 0.078818 seconds and 4 git commands to generate.