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.

37 lines
1.2 KiB

  1. #!/usr/bin/env sh
  2. dns_he_ddns_info='Hurricane Electric HE.net DDNS
  3. Site: dns.he.net
  4. Docs: github.com/acmesh-official/acme.sh/wiki/dnsapi#dns_he_ddns
  5. Options:
  6. HE_DDNS_KEY The DDNS key for updating the TXT record
  7. Author: Markku Leiniö
  8. '
  9. HE_DDNS_URL="https://dyn.dns.he.net/nic/update"
  10. ######## Public functions #####################
  11. #Usage: dns_he_ddns_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
  12. dns_he_ddns_add() {
  13. fulldomain=$1
  14. txtvalue=$2
  15. HE_DDNS_KEY="${HE_DDNS_KEY:-$(_readaccountconf_mutable HE_DDNS_KEY)}"
  16. if [ -z "$HE_DDNS_KEY" ]; then
  17. HE_DDNS_KEY=""
  18. _err "You didn't specify a DDNS key for accessing the TXT record in HE API."
  19. return 1
  20. fi
  21. #Save the DDNS key to the account conf file.
  22. _saveaccountconf_mutable HE_DDNS_KEY "$HE_DDNS_KEY"
  23. _info "Using Hurricane Electric DDNS API"
  24. _debug fulldomain "$fulldomain"
  25. _debug txtvalue "$txtvalue"
  26. response="$(_post "hostname=$fulldomain&password=$HE_DDNS_KEY&txt=$txtvalue" "$HE_DDNS_URL")"
  27. _info "Response: $response"
  28. _contains "$response" "good" && return 0 || return 1
  29. }
  30. # dns_he_ddns_rm() is not implemented because the API call always updates the
  31. # contents of the existing record (that the API key gives access to).