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.

61 lines
874 B

  1. #!/bin/bash
  2. #Here is a sample custom api script.
  3. #This file name is "dhs-myapi.sh"
  4. #So, here must be a method dhs-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. _debug() {
  17. if [ -z "$DEBUG" ] ; then
  18. return
  19. fi
  20. if [ -z "$2" ] ; then
  21. echo $1
  22. else
  23. echo "$1"="$2"
  24. fi
  25. }
  26. _info() {
  27. if [ -z "$2" ] ; then
  28. echo "$1"
  29. else
  30. echo "$1"="$2"
  31. fi
  32. }
  33. _err() {
  34. if [ -z "$2" ] ; then
  35. echo "$1" >&2
  36. else
  37. echo "$1"="$2" >&2
  38. fi
  39. }