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.

44 lines
1.3 KiB

9 years ago
9 years ago
6 years ago
9 years ago
8 years ago
8 years ago
  1. #!/usr/bin/env sh
  2. # shellcheck disable=SC2034
  3. dns_myapi_info='Custom API Example
  4. A sample custom DNS API script.
  5. Domains: example.com
  6. Site: github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide
  7. Docs: github.com/acmesh-official/acme.sh/wiki/dnsapi#dns_duckdns
  8. Options:
  9. MYAPI_Token API Token. Get API Token from https://example.com/api/. Optional.
  10. Issues: github.com/acmesh-official/acme.sh
  11. Author: Neil Pang <neilgit@neilpang.com>
  12. '
  13. #This file name is "dns_myapi.sh"
  14. #So, here must be a method dns_myapi_add()
  15. #Which will be called by acme.sh to add the txt record to your api system.
  16. #returns 0 means success, otherwise error.
  17. ######## Public functions #####################
  18. # Please Read this guide first: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide
  19. #Usage: dns_myapi_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
  20. dns_myapi_add() {
  21. fulldomain=$1
  22. txtvalue=$2
  23. _info "Using myapi"
  24. _debug fulldomain "$fulldomain"
  25. _debug txtvalue "$txtvalue"
  26. _err "Not implemented!"
  27. return 1
  28. }
  29. #Usage: fulldomain txtvalue
  30. #Remove the txt record after validation.
  31. dns_myapi_rm() {
  32. fulldomain=$1
  33. txtvalue=$2
  34. _info "Using myapi"
  35. _debug fulldomain "$fulldomain"
  36. _debug txtvalue "$txtvalue"
  37. }
  38. #################### Private functions below ##################################