#!/usr/bin/env bash ######## Public functions ##################### #Usage: dns_nsupdate_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs" dns_nsupdate_add() { fulldomain=$1 txtvalue=$2 _checkKeyFile || return 1 NSUPDATE_SERVER=${NSUPDATE_SERVER:-localhost} tmp=$(mktemp --tmpdir acme_nsupdate.XXXXXX) cat > ${tmp} <> ${NSUPDATE_LOG} return 0 } #Usage: dns_nsupdate_del _acme-challenge.www.domain.com dns_nsupdate_del() { fulldomain=$1 _checkKeyFile || return 1 NSUPDATE_SERVER=${NSUPDATE_SERVER:-localhost} tmp=$(mktemp --tmpdir acme_nsupdate.XXXXXX) cat > ${tmp} <&2 return 1 } _debug() { if [ -z "$DEBUG" ] ; then return fi _err "$@" return 0 } _debug2() { if [ "$DEBUG" ] && [ "$DEBUG" -ge "2" ] ; then _debug "$@" fi return }