]> git.proxmox.com Git - mirror_acme.sh.git/blob - deploy/keychain.sh
Merge pull request #710 from Neilpang/dev
[mirror_acme.sh.git] / deploy / keychain.sh
1 #!/usr/bin/env sh
2
3 #Here is a sample custom api script.
4 #This file name is "myapi.sh"
5 #So, here must be a method myapi_deploy()
6 #Which will be called by acme.sh to deploy the cert
7 #returns 0 means success, otherwise error.
8
9 ######## Public functions #####################
10
11 #domain keyfile certfile cafile fullchain
12 keychain_deploy() {
13 _cdomain="$1"
14 _ckey="$2"
15 _ccert="$3"
16 _cca="$4"
17 _cfullchain="$5"
18
19 _debug _cdomain "$_cdomain"
20 _debug _ckey "$_ckey"
21 _debug _ccert "$_ccert"
22 _debug _cca "$_cca"
23 _debug _cfullchain "$_cfullchain"
24
25 /usr/bin/security import "$_ckey" -k "/Library/Keychains/System.keychain"
26 /usr/bin/security import "$_ccert" -k "/Library/Keychains/System.keychain"
27 /usr/bin/security import "$_cca" -k "/Library/Keychains/System.keychain"
28 /usr/bin/security import "$_cfullchain" -k "/Library/Keychains/System.keychain"
29
30 return 0
31 }