summaryrefslogtreecommitdiffstats
path: root/dehydrated/bin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-09-06 13:52:53 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-09-06 13:56:14 +0000
commit545e1c227af3636fd28cd8d195ad17be53e8cb9d (patch)
tree478db61621c0ed564bb8455fd213df2fc9169da4 /dehydrated/bin
parentImproving wording of TSIG lookup hierarchy in dehydrated-nsupdate.1. (diff)
downloadservice-tools-545e1c227af3636fd28cd8d195ad17be53e8cb9d.tar.xz
service-tools-545e1c227af3636fd28cd8d195ad17be53e8cb9d.zip
Temporarily passing tsig string to bind in dehydrated-nsupdate to unbreak bind support, bind requires a different keyfile format as knot.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xdehydrated/bin/dehydrated-nsupdate24
1 files changed, 21 insertions, 3 deletions
diff --git a/dehydrated/bin/dehydrated-nsupdate b/dehydrated/bin/dehydrated-nsupdate
index 05027ab..ea86daa 100755
--- a/dehydrated/bin/dehydrated-nsupdate
+++ b/dehydrated/bin/dehydrated-nsupdate
@@ -59,16 +59,26 @@ fi
if command -v knsupdate > /dev/null 2>&1
then
# knot-dnsutils
- NSUPDATE="knsupdate"
+ NSUPDATE_VARIANT="knot"
elif command -v nsupdate > /dev/null 2>&1
then
# bind-dnsutils
- NSUPDATE="nsupdate"
+ NSUPDATE_VARIANT="bind"
else
echo "'${HOOK}': need nsupdate from bind-dnsutils or knot-dnsutils" >&2
exit 1
fi
+case "${NSUPDATE_VARIANT}" in
+ knot)
+ NSUPDATE="knsupdate"
+ ;;
+
+ bind)
+ NSUPDATE="nsupdate"
+ ;;
+esac
+
# config
for FILE in /etc/default/dehydrated-nsupdate /etc/default/dehydrated-nsupdate.d/*
do
@@ -168,7 +178,15 @@ do
if [ -n "${KEY}" ] && [ -n "${TSIG}" ]
then
- NSUPDATE_OPTIONS="-k ${KEY}"
+ case "${NSUPDATE_VARIANT}" in
+ knot)
+ NSUPDATE_OPTIONS="-k ${KEY}"
+ ;;
+
+ bind)
+ NSUPDATE_OPTIONS="-y $(cat "${KEY}")"
+ ;;
+ esac
fi
echo -n " + sending '${HOOK_ACTION}' for ${TXT_RECORD} to ${NAMESERVER}..."