summaryrefslogtreecommitdiffstats
path: root/dehydrated/bin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-10-30 12:57:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-10-30 12:57:16 +0000
commit56fa85dba2506fa0ceb38190bc3e428ddcc117dc (patch)
treeaa87a3873cfc3e5e9d5736d69dd98714628d90f7 /dehydrated/bin
parentReleasing debian version 20220704-1. (diff)
downloadopen-infrastructure-service-tools-56fa85dba2506fa0ceb38190bc3e428ddcc117dc.tar.xz
open-infrastructure-service-tools-56fa85dba2506fa0ceb38190bc3e428ddcc117dc.zip
Merging upstream version 20221030.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dehydrated/bin')
-rwxr-xr-xdehydrated/bin/dehydrated-nsupdate38
1 files changed, 33 insertions, 5 deletions
diff --git a/dehydrated/bin/dehydrated-nsupdate b/dehydrated/bin/dehydrated-nsupdate
index 05027ab..c6bf6c5 100755
--- a/dehydrated/bin/dehydrated-nsupdate
+++ b/dehydrated/bin/dehydrated-nsupdate
@@ -45,30 +45,50 @@ esac
if command -v kdig > /dev/null 2>&1
then
# knot-dnsutils
- DIG="kdig +noidn"
+ DIG_VARIANT="knot"
elif command -v dig > /dev/null 2>&1
then
# bind-dnsutils
- DIG="dig +noidnout"
+ DIG_VARIANT="bind"
else
echo "'${HOOK}': need dig from bind-dnsutils or knot-dnsutils" >&2
exit 1
fi
+case "${DIG_VARIANT}" in
+ knot)
+ DIG="kdig +noidn"
+ ;;
+
+ bind)
+ DIG="dig +noidnout"
+ ;;
+esac
+
# alternatives handling for nsupdate
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 +188,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}..."