3 #use dns-01 at DNSExit.com
5 #Author: Samuel Jimenez
6 #Report Bugs here: https://github.com/acmesh-official/acme.sh
8 #DNSEXIT_API_KEY=ABCDEFGHIJ0123456789abcdefghij
9 #DNSEXIT_AUTH_USER=login@email.address
10 #DNSEXIT_AUTH_PASS=aStrongPassword
11 DNSEXIT_API_URL
="https://api.dnsexit.com/dns/"
12 DNSEXIT_HOSTS_URL
="https://update.dnsexit.com/ipupdate/hosts.jsp"
14 ######## Public functions #####################
15 #Usage: dns_dnsexit_add _acme-challenge.*.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
19 _info
"Using DNSExit.com"
20 _debug fulldomain
"$fulldomain"
21 _debug txtvalue
"$txtvalue"
23 _debug
'Load account auth'
24 if ! get_account_info
; then
28 _debug
'First detect the root zone'
29 if ! _get_root
"$fulldomain"; then
32 _debug _sub_domain
"$_sub_domain"
33 _debug _domain
"$_domain"
35 if ! _dnsexit_rest
"{\"domain\":\"$_domain\",\"add\":{\"type\":\"TXT\",\"name\":\"$_sub_domain\",\"content\":\"$txtvalue\",\"ttl\":0,\"overwrite\":false}}"; then
40 _debug2 _response
"$response"
44 #Usage: fulldomain txtvalue
45 #Remove the txt record after validation.
49 _info
"Using DNSExit.com"
50 _debug fulldomain
"$fulldomain"
51 _debug txtvalue
"$txtvalue"
53 _debug
'Load account auth'
54 if ! get_account_info
; then
58 _debug
'First detect the root zone'
59 if ! _get_root
"$fulldomain"; then
63 _debug _sub_domain
"$_sub_domain"
64 _debug _domain
"$_domain"
66 if ! _dnsexit_rest
"{\"domain\":\"$_domain\",\"delete\":{\"type\":\"TXT\",\"name\":\"$_sub_domain\",\"content\":\"$txtvalue\"}}"; then
71 _debug2 _response
"$response"
75 #################### Private functions below ##################################
76 #_acme-challenge.www.domain.com
78 # _sub_domain=_acme-challenge.www
84 _domain
=$
(printf "%s" "$domain" | cut
-d .
-f $i-100)
86 if [ -z "$_domain" ]; then
90 _debug login
"$DNSEXIT_AUTH_USER"
91 _debug password
"$DNSEXIT_AUTH_PASS"
92 _debug domain
"$_domain"
94 _dnsexit_http
"login=$DNSEXIT_AUTH_USER&password=$DNSEXIT_AUTH_PASS&domain=$_domain"
96 if _contains
"$response" "0=$_domain"; then
97 _sub_domain
="$(echo "$fulldomain" | sed "s
/\\.
$_domain\$
//")"
100 _debug
"Go to next level of $_domain"
112 _debug _dnsexit_rest
"$ep"
115 api_key_trimmed
=$
(echo "$DNSEXIT_API_KEY" |
tr -d '"')
117 export _H1
="apikey: $api_key_trimmed"
118 export _H2
='Content-Type: application/json'
120 if [ "$m" != "GET" ]; then
122 response
="$(_post "$data" "$DNSEXIT_API_URL/$ep" "" "$m")"
124 response
="$(_get "$DNSEXIT_API_URL/$ep")"
127 if [ "$?" != "0" ]; then
132 _debug2 response
"$response"
139 _debug param
"$param"
140 _debug get
"$DNSEXIT_HOSTS_URL?$param"
142 response
="$(_get "$DNSEXIT_HOSTS_URL?
$param")"
144 _debug response
"$response"
146 if [ "$?" != "0" ]; then
151 _debug2 response
"$response"
157 DNSEXIT_API_KEY
="${DNSEXIT_API_KEY:-$(_readaccountconf_mutable DNSEXIT_API_KEY)}"
158 if test -z "$DNSEXIT_API_KEY"; then
160 _err
'DNSEXIT_API_KEY was not exported'
164 _saveaccountconf_mutable DNSEXIT_API_KEY
"$DNSEXIT_API_KEY"
166 DNSEXIT_AUTH_USER
="${DNSEXIT_AUTH_USER:-$(_readaccountconf_mutable DNSEXIT_AUTH_USER)}"
167 if test -z "$DNSEXIT_AUTH_USER"; then
169 _err
'DNSEXIT_AUTH_USER was not exported'
173 _saveaccountconf_mutable DNSEXIT_AUTH_USER
"$DNSEXIT_AUTH_USER"
175 DNSEXIT_AUTH_PASS
="${DNSEXIT_AUTH_PASS:-$(_readaccountconf_mutable DNSEXIT_AUTH_PASS)}"
176 if test -z "$DNSEXIT_AUTH_PASS"; then
178 _err
'DNSEXIT_AUTH_PASS was not exported'
182 _saveaccountconf_mutable DNSEXIT_AUTH_PASS
"$DNSEXIT_AUTH_PASS"