]> git.proxmox.com Git - mirror_acme.sh.git/blob - dnsapi/dns_myapi.sh
minor
[mirror_acme.sh.git] / dnsapi / dns_myapi.sh
1 #!/usr/bin/env sh
2
3 #Here is a sample custom api script.
4 #This file name is "dns_myapi.sh"
5 #So, here must be a method dns_myapi_add()
6 #Which will be called by acme.sh to add the txt record to your api system.
7 #returns 0 means success, otherwise error.
8
9
10
11 ######## Public functions #####################
12
13 #Usage: dns_myapi_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
14 dns_myapi_add() {
15 fulldomain=$1
16 txtvalue=$2
17 _err "Not implemented!"
18 return 1;
19 }
20
21
22
23
24
25 #################### Private functions bellow ##################################
26 _info() {
27 if [ -z "$2" ] ; then
28 echo "[$(date)] $1"
29 else
30 echo "[$(date)] $1='$2'"
31 fi
32 }
33
34 _err() {
35 _info "$@" >&2
36 return 1
37 }
38
39 _debug() {
40 if [ -z "$DEBUG" ] ; then
41 return
42 fi
43 _err "$@"
44 return 0
45 }
46
47 _debug2() {
48 if [ "$DEBUG" ] && [ "$DEBUG" -ge "2" ] ; then
49 _debug "$@"
50 fi
51 return
52 }