From faa702a4e5d3a1c4f2654dacfb35a946258b2ca6 Mon Sep 17 00:00:00 2001 From: Roman Danko Date: Fri, 7 Aug 2020 22:40:50 +0200 Subject: [PATCH] Introduced variable KNOT_ZONE to resolve issue #2881 --- dnsapi/dns_knot.sh | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/dnsapi/dns_knot.sh b/dnsapi/dns_knot.sh index 094a6981..9c9bc0fa 100644 --- a/dnsapi/dns_knot.sh +++ b/dnsapi/dns_knot.sh @@ -8,9 +8,12 @@ dns_knot_add() { txtvalue=$2 _checkKey || return 1 [ -n "${KNOT_SERVER}" ] || KNOT_SERVER="localhost" + KNOT_ZONE="${KNOT_ZONE:-$(_readaccountconf_mutable KNOT_ZONE)}" + # save the dns server and key to the account.conf file. _saveaccountconf KNOT_SERVER "${KNOT_SERVER}" _saveaccountconf KNOT_KEY "${KNOT_KEY}" + _saveaccountconf KNOT_ZONE "${KNOT_ZONE}" if ! _get_root "$fulldomain"; then _err "Domain does not exist." @@ -18,14 +21,23 @@ dns_knot_add() { fi _info "Adding ${fulldomain}. 60 TXT \"${txtvalue}\"" - - knsupdate -y "${KNOT_KEY}" <