Skip to content

Commit 34cf75e

Browse files
committed
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.
1 parent 4d36be4 commit 34cf75e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

dns_scripts/dns_nodelete

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# For debugging, use this as the DNS update "delete" driver
4+
#
5+
# It will log whatever seems interesting in /tmp/dns_nodelete.log, but
6+
# it will NOT delete the tokens. Currently used with nsupdate, but
7+
# variables for other drivers are welcome. This is mainly for debugging
8+
# CNAME aliasing & token cleanup tools.
9+
10+
(
11+
NOLOG="/tmp/dns_nodelete.log"
12+
NOSTAMP="$(date +'%a, %d-%b-%Y %T.%N'): "
13+
NODOMAIN="$1"
14+
NOTOKEN="$2"
15+
NOVARS="DNS_.*|*NODOMAIN|NOTOKEN*"
16+
17+
set | grep -E "^($NOVARS)=" | while read -r ; do echo "${NOSTAMP}$REPLY" >>$NOLOG; done
18+
19+
echo "${NOSTAMP}update delete ${DNS_ZONE:-"_acme-challenge.${NODOMAIN}."} 300 in TXT \"${NOTOKEN}\"\n" >>"$NOLOG"
20+
)

0 commit comments

Comments
 (0)