From 34cf75e4f4aa7fd8d193ed3a2fd2243dc86d0360 Mon Sep 17 00:00:00 2001 From: Timothe Litt Date: Sat, 16 Mar 2024 19:40:23 -0400 Subject: [PATCH] Add dns_scripts/dns_nodelete This is useful for debugging; it leaves any tokens in the DNS & records its environment. It's only meaningful for debuggers (and some problem reports for which ask for them. --- dns_scripts/dns_nodelete | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 dns_scripts/dns_nodelete diff --git a/dns_scripts/dns_nodelete b/dns_scripts/dns_nodelete new file mode 100755 index 00000000..cd5a04ed --- /dev/null +++ b/dns_scripts/dns_nodelete @@ -0,0 +1,20 @@ +#!/bin/bash + +# For debugging, use this as the DNS update "delete" driver +# +# It will log whatever seems interesting in /tmp/dns_nodelete.log, but +# it will NOT delete the tokens. Currently used with nsupdate, but +# variables for other drivers are welcome. This is mainly for debugging +# CNAME aliasing & token cleanup tools. + +( +NOLOG="/tmp/dns_nodelete.log" +NOSTAMP="$(date +'%a, %d-%b-%Y %T.%N'): " +NODOMAIN="$1" +NOTOKEN="$2" +NOVARS="DNS_.*|*NODOMAIN|NOTOKEN*" + +set | grep -E "^($NOVARS)=" | while read -r ; do echo "${NOSTAMP}$REPLY" >>$NOLOG; done + +echo "${NOSTAMP}update delete ${DNS_ZONE:-"_acme-challenge.${NODOMAIN}."} 300 in TXT \"${NOTOKEN}\"\n" >>"$NOLOG" +) \ No newline at end of file