Skip to content

Commit

Permalink
Add dns_scripts/dns_nodelete
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tlhackque committed Mar 16, 2024
1 parent 4d36be4 commit 34cf75e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions dns_scripts/dns_nodelete
Original file line number Diff line number Diff line change
@@ -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"
)

0 comments on commit 34cf75e

Please sign in to comment.