From a126059f33c6f97c65d63c12911d342368ce0323 Mon Sep 17 00:00:00 2001 From: Florin Boariu Date: Tue, 6 Aug 2024 17:01:45 +0200 Subject: [PATCH] cat'ed zone contents instead of mv'ing file -- this helps preserve old owner/permissions on the zonefile --- dnsapi/dns_nsd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnsapi/dns_nsd.sh b/dnsapi/dns_nsd.sh index 83e93293..1ca81094 100644 --- a/dnsapi/dns_nsd.sh +++ b/dnsapi/dns_nsd.sh @@ -56,7 +56,7 @@ dns_nsd_add() { local zone_serial_next=$[$zone_serial+1] local tmp_zonefile=$(mktemp) cat "$Nsd_ZoneFile" | sed "s/$zone_serial/$zone_serial_next/" > "$tmp_zonefile" - mv "$tmp_zonefile" "$Nsd_ZoneFile" + cat "$tmp_zonefile" > "$Nsd_ZoneFile" rm -rf "$tmp_zonefile" _info "Added TXT record for $fulldomain"