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.

62 lines
966 B

9 years ago
  1. #!/bin/bash
  2. #Here is a sample custom api script.
  3. #This file name is "dns-myapi.sh"
  4. #So, here must be a method dns-myapi-add()
  5. #Which will be called by le.sh to add the txt record to your api system.
  6. #returns 0 meanst success, otherwise error.
  7. ######## Public functions #####################
  8. #Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
  9. dns-myapi-add() {
  10. fulldomain=$1
  11. txtvalue=$2
  12. _err "Not implemented!"
  13. return 1;
  14. }
  15. #################### Private functions bellow ##################################
  16. _info() {
  17. if [[ -z "$2" ]] ; then
  18. echo "[$(date)] $1"
  19. else
  20. echo "[$(date)] $1"="'$2'"
  21. fi
  22. }
  23. _err() {
  24. _info "$@" >&2
  25. return 1
  26. }
  27. _debug() {
  28. if [[ -z "$DEBUG" ]] ; then
  29. return
  30. fi
  31. _err "$@"
  32. return 0
  33. }
  34. _debug2() {
  35. if [[ "$DEBUG" -ge "2" ]] ; then
  36. _debug "$@"
  37. fi
  38. return
  39. }
  40. #################### Private functions bellow ##################################