You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
884 B

  1. #!/usr/bin/env bash
  2. #Here is a sample custom api script.
  3. #This file name is "myapi.sh"
  4. #So, here must be a method myapi_deploy()
  5. #Which will be called by acme.sh to deploy the cert
  6. #returns 0 means success, otherwise error.
  7. ######## Public functions #####################
  8. #domain keyfile certfile cafile fullchain
  9. strongswan_deploy() {
  10. _cdomain="$1"
  11. _ckey="$2"
  12. _ccert="$3"
  13. _cca="$4"
  14. _cfullchain="$5"
  15. _debug _cdomain "$_cdomain"
  16. _debug _ckey "$_ckey"
  17. _debug _ccert "$_ccert"
  18. _debug _cca "$_cca"
  19. _debug _cfullchain "$_cfullchain"
  20. # _err "Not implemented yet"
  21. # return 1
  22. cp -pv $_ckey /etc/ipsec.d/private/$(basename $_ckey)
  23. cp -pv $_ccert /etc/ipsec.d/certs/$(basename $_ccert)
  24. cp -pv $_cca /etc/ipsec.d/cacerts/$(basename $_cca)
  25. cp -pv $_cfullchain /etc/ipsec.d/cacerts/$(basename $_cfullchain)
  26. ipsec secrets
  27. return 0
  28. }