diff mod_dnsupdate/mod_dnsupdate.lua @ 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 6395d4732bc6
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