#!/usr/bin/env sh # shellcheck disable=SC2034 dns_knot_info='Knot Server knsupdate Site: www.knot-dns.cz/docs/2.5/html/man_knsupdate.html Docs: github.com/acmesh-official/acme.sh/wiki/dnsapi#dns_knot Options: KNOT_SERVER Server hostname. Default: "localhost". KNOT_KEY TSIG key data, not a file path. knsupdate "key" statement format: "[alg:]name secret". E.g. "hmac-sha256:acme_key BASE64SECRET=" KNOT_ZONE Zone name. Optional, set it when the challenge record lives in a delegated subdomain zone. Default: the parent domain of the challenge record. ' # See also dns_nsupdate.sh ######## Public functions ##################### #Usage: dns_knot_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs" dns_knot_add() { fulldomain=$1 txtvalue=$2 _checkKey || return 1 [ -n "${KNOT_SERVER}" ] || KNOT_SERVER="localhost" # save the dns server and key to the account.conf file. _saveaccountconf KNOT_SERVER "${KNOT_SERVER}" _saveaccountconf KNOT_KEY "${KNOT_KEY}" if [ -n "${KNOT_ZONE}" ]; then _saveaccountconf KNOT_ZONE "${KNOT_ZONE}" fi if ! _get_root "$fulldomain"; then _err "Domain does not exist." return 1 fi _info "Adding ${fulldomain}. 60 TXT \"${txtvalue}\"" knsupdate <