From 3d80df43cd459d1985fd419d805335d852f4c38f Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Tue, 14 Jun 2016 18:12:13 +0200 Subject: [PATCH] Remove the need for a temporary file --- example-dns-01-nsupdate-script.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/example-dns-01-nsupdate-script.md b/example-dns-01-nsupdate-script.md index faacdd0..40cd638 100644 --- a/example-dns-01-nsupdate-script.md +++ b/example-dns-01-nsupdate-script.md @@ -16,20 +16,16 @@ set -u set -o pipefail umask 077 -updatefile="$(mktemp)" - NSUPDATE="nsupdate -k /path/to/Kdnsupdatekey.private" done="no" if [[ "$1" = "deploy_challenge" ]]; then - printf "update add _acme-challenge.%s. 300 in TXT \"%s\"\n\n" "${2}" "${4}" > "${updatefile}" - $NSUPDATE "${updatefile}" + printf "update add _acme-challenge.%s. 300 in TXT \"%s\"\n\n" "${2}" "${4}" | $NSUPDATE done="yes" fi if [[ "$1" = "clean_challenge" ]]; then - printf "update delete _acme-challenge.%s. 300 in TXT \"%s\"\n\n" "${2}" "${4}" > "${updatefile}" - $NSUPDATE "${updatefile}" + printf "update delete _acme-challenge.%s. 300 in TXT \"%s\"\n\n" "${2}" "${4}" | $NSUPDATE done="yes" fi @@ -38,8 +34,6 @@ if [[ "${1}" = "deploy_cert" ]]; then done="yes" fi -rm -f "${updatefile}" - if [[ ! "${done}" = "yes" ]]; then echo Unkown hook "${1}" exit 1