summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--type/__dtnrch_getssl_script_henet/files/dns_add_henet27
1 files changed, 23 insertions, 4 deletions
diff --git a/type/__dtnrch_getssl_script_henet/files/dns_add_henet b/type/__dtnrch_getssl_script_henet/files/dns_add_henet
index ec3a969..eed43ba 100644
--- a/type/__dtnrch_getssl_script_henet/files/dns_add_henet
+++ b/type/__dtnrch_getssl_script_henet/files/dns_add_henet
@@ -15,7 +15,26 @@ trap echo EXIT
hostname=$(resolve_cnames "_acme-challenge.${FULLDOMAIN}")
-curl -sS 'https://dyn.dns.he.net/nic/update' \
- -d hostname="${hostname}" \
- -d password=%%PASSWORD%% \
- -d txt="${DNS_TOKEN}"
+response=$(
+ curl -sS 'https://dyn.dns.he.net/nic/update' \
+ -d hostname="${hostname}" \
+ -d password=%%PASSWORD%% \
+ -d txt="${DNS_TOKEN}")
+
+case ${response}
+in
+ (good*)
+ echo 'good'
+ ;;
+ (badauth)
+ echo 'badauth: Authentication failed.' >&2
+ exit 1
+ ;;
+ (nochg*)
+ printf '%s\n' "${response}"
+ ;;
+ (*)
+ printf '%s\n' "${response}"
+ exit 1
+ ;;
+esac