From 1e80d8279b75d3a586f6da66d7057578ec2b8f2a Mon Sep 17 00:00:00 2001 From: John B Date: Thu, 3 Feb 2022 17:24:35 -0800 Subject: [PATCH] Fixed DNS Exit API endpoint url - placed in variable --- dnsapi/dns_japi.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dnsapi/dns_japi.sh b/dnsapi/dns_japi.sh index bffe6370..a1b748ab 100755 --- a/dnsapi/dns_japi.sh +++ b/dnsapi/dns_japi.sh @@ -18,6 +18,7 @@ dns_japi_add() { fulldomain=$1 txtvalue=$2 + apiendpoint="https://api.dnsexit.com/dns/" #_debug "Domain being used with custom script is: $domain" fullchallengedomain="${JAPI_domain:-$(_readaccountconf_mutable JAPI_domain)}" _debug "Full Challenge Domain is: $fullchallengedomain" @@ -48,7 +49,7 @@ dns_japi_add() { _debug txtvalue "$txtvalue" #_err "Not implemented!" - response="$(_post "{\"domain\":\"$domain\",\"update\": {\"type\":\"TXT\",\"name\":\"$fullchallengedomain\",\"content\":\"$txtvalue\",\"ttl\":0}}" https://api.dnsexit.com/dns/ "" POST "application/json")" + response="$(_post "{\"domain\":\"$domain\",\"update\": {\"type\":\"TXT\",\"name\":\"$fullchallengedomain\",\"content\":\"$txtvalue\",\"ttl\":0}}" $apiendpoint "" POST "application/json")" if ! printf "%s" "$response" | grep \"code\":0>/dev/null; then _err "There was an error updating the TXT record..." _err "DNS Exit API response: $response" @@ -62,6 +63,7 @@ dns_japi_add() { dns_japi_rm() { fulldomain=$1 txtvalue=$2 + apiendpoint="https://api.dnsexit.com/dns/" #_debug "Domain being used with custom script is: $domain" fullchallengedomain="${JAPI_domain:-$(_readaccountconf_mutable JAPI_domain)}" _debug "Full Challenge Domain is: $fullchallengedomain" @@ -86,7 +88,7 @@ dns_japi_rm() { _debug "Full Challenge domain: $fullchallengedomain" _debug txtvalue "$txtvalue" #_err "Not implemented!" - response="$(_post "{\"domain\":\"$domain\",\"delete\": {\"type\":\"TXT\",\"name\":\"$fullchallengedomain\",\"content\":\"$txtvalue\",\"ttl\":0}}" https://api.dnsexit.com/dns/ "" POST "application/json")" + response="$(_post "{\"domain\":\"$domain\",\"delete\": {\"type\":\"TXT\",\"name\":\"$fullchallengedomain\",\"content\":\"$txtvalue\",\"ttl\":0}}" $apiendpoint "" POST "application/json")" if ! printf "%s" "$response" | grep \"code\":0>/dev/null; then _err "There was an error deleting the TXT record..." _err "DNS Exit API response: $response"