]>
git.proxmox.com Git - mirror_acme.sh.git/blob - deploy/strongswan.sh
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.
9 ######## Public functions #####################
11 #domain keyfile certfile cafile fullchain
19 _info
"Using strongswan"
21 if [ -x /usr
/sbin
/ipsec
]; then
22 _ipsec
=/usr
/sbin
/ipsec
23 elif [ -x /usr
/sbin
/strongswan
]; then
24 _ipsec
=/usr
/sbin
/strongswan
25 elif [ -x /usr
/local
/sbin
/ipsec
]; then
26 _ipsec
=/usr
/local
/sbin
/ipsec
28 _err
"no strongswan or ipsec command is detected"
32 _info _ipsec
"$_ipsec"
34 _confdir
=$
($_ipsec --confdir)
35 if [ $?
-ne 0 ] ||
[ -z "$_confdir" ]; then
36 _err
"no strongswan --confdir is detected"
40 _info _confdir
"$_confdir"
42 _debug _cdomain
"$_cdomain"
44 _debug _ccert
"$_ccert"
46 _debug _cfullchain
"$_cfullchain"
48 cat "$_ckey" >"${_confdir}/ipsec.d/private/$(basename "$_ckey")"
49 cat "$_ccert" >"${_confdir}/ipsec.d/certs/$(basename "$_ccert")"
50 cat "$_cca" >"${_confdir}/ipsec.d/cacerts/$(basename "$_cca")"
51 cat "$_cfullchain" >"${_confdir}/ipsec.d/cacerts/$(basename "$_cfullchain")"