changeset 4765:3632836f35b0

mod_dnsupdate: Restore the --each option
author Kim Alvefur <zash@zash.se>
date Mon, 08 Nov 2021 23:07:01 +0100
parents a754f7e380b2
children abac64f71698
files mod_dnsupdate/mod_dnsupdate.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_dnsupdate/mod_dnsupdate.lua	Mon Nov 08 23:03:14 2021 +0100
+++ b/mod_dnsupdate/mod_dnsupdate.lua	Mon Nov 08 23:07:01 2021 +0100
@@ -104,6 +104,9 @@
 			for _, rr in ipairs(records) do
 				if ports:contains(rr.srv.port) and target == nameprep(rr.srv.target):gsub("%.$", "") then
 					ports:remove(rr.srv.port)
+				elseif not opts.each then
+					print(("del _%s._tcp.%s IN SRV"):format(service, ihost));
+					break
 				else
 					print(("del _%s._tcp.%s IN SRV %s"):format(service, ihost, rr));
 				end