From 4e7e13ca6c42984af2475d164f211a5cc271d606 Mon Sep 17 00:00:00 2001 From: Robbie Mckennie Date: Wed, 2 Oct 2019 21:19:02 +1300 Subject: [PATCH] Nsupdate one-liner (#393) Pipe the commands to nsupdate --- dns_scripts/dns_add_nsupdate | 8 +------- dns_scripts/dns_del_nsupdate | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/dns_scripts/dns_add_nsupdate b/dns_scripts/dns_add_nsupdate index 9e8ebfe..891614e 100755 --- a/dns_scripts/dns_add_nsupdate +++ b/dns_scripts/dns_add_nsupdate @@ -7,10 +7,4 @@ dnskeyfile="path/to/bla.key" fulldomain="$1" token="$2" -updatefile=$(mktemp) - -printf "update add _acme-challenge.%s. 300 in TXT \"%s\"\n\n" "${fulldomain}" "${token}" > "${updatefile}" - -nsupdate -k "${dnskeyfile}" -v "${updatefile}" - -rm -f "${updatefile}" +printf "update add _acme-challenge.%s. 300 in TXT \"%s\"\n\n" "${fulldomain}" "${token}" | nsupdate -k "${dnskeyfile}" -v diff --git a/dns_scripts/dns_del_nsupdate b/dns_scripts/dns_del_nsupdate index 62291b7..808b21c 100755 --- a/dns_scripts/dns_del_nsupdate +++ b/dns_scripts/dns_del_nsupdate @@ -6,10 +6,4 @@ dnskeyfile="path/to/bla.key" fulldomain="$1" token="$2" -updatefile=$(mktemp) - -printf "update delete _acme-challenge.%s. 300 in TXT \"%s\"\n\n" "${fulldomain}" "${token}" > "${updatefile}" - -nsupdate -k "${dnskeyfile}" -v "${updatefile}" - -rm -f "${updatefile}" +printf "update delete _acme-challenge.%s. 300 in TXT \"%s\"\n\n" "${fulldomain}" "${token}" | nsupdate -k "${dnskeyfile}" -v