]>
Commit | Line | Data |
---|---|---|
df0e469f A |
1 | #!/usr/bin/perl |
2 | # | |
3 | # Use to gather certificates into specified keychain. | |
4 | # | |
5 | $numFiles = $#ARGV; | |
6 | if($numFiles < 1) { | |
7 | print "usage: makecerts keychainfile cert...\n"; | |
8 | die; | |
9 | } | |
10 | $dbname = $ARGV[0]; | |
11 | ||
12 | my $count = 0; | |
13 | my $created; | |
14 | foreach $argnum (1 .. $numFiles) { | |
15 | $thisCert = $ARGV[$argnum]; | |
16 | my @cmd = ("certtool", "i", $thisCert, "k=$dbname", "d"); | |
17 | do { push @cmd, "c"; $created = 1; } unless $created; | |
18 | print "$thisCert "; | |
19 | die if system @cmd; | |
20 | $count++; | |
21 | } | |
22 | ||
23 | print "$count certificates placed into $dbname\n"; | |
24 | exit 0; |