]> git.saurik.com Git - apple/security.git/blob - keychains/postinstall.sh
Security-176.tar.gz
[apple/security.git] / keychains / postinstall.sh
1 #!/bin/sh
2
3 # Create keychains if not there already
4 if [ ! -f "$targetdisk/System/Library/Keychains/X509Anchors" ]; then
5 "$targetdisk/usr/bin/security" create-keychain -p X509Anchors "$targetdisk/System/Library/Keychains/X509Anchors"
6 fi
7 if [ ! -f "$targetdisk/System/Library/Keychains/X509Certificates" ]; then
8 "$targetdisk/usr/bin/security" create-keychain -p X509Certificates "$targetdisk/System/Library/Keychains/X509Certificates"
9 fi
10
11 # Add all anchors
12 cd "$targetdisk/System/Library/Keychains/Anchors/"
13 "$targetdisk/usr/bin/security" add-certificate -k "$targetdisk/System/Library/Keychains/X509Anchors" *
14
15 # Add all intermediates
16 cd "$targetdisk/System/Library/Keychains/Certificates/"
17 "$targetdisk/usr/bin/security" add-certificate -k "$targetdisk/System/Library/Keychains/X509Certificates" *
18
19 # we might want to delete the raw certificate files, in the interest of cruft cleanup
20 #rm -rf "$targetdisk/System/Library/Keychains/Anchors"
21 #rm -rf "$targetdisk/System/Library/Keychains/Certificates"