mod_dnsupdate: Restore the --each option
authorKim Alvefur <zash@zash.se>
Mon, 08 Nov 2021 23:07:01 +0100
changeset 4769 3632836f35b0
parent 4768 a754f7e380b2
child 4770 abac64f71698
mod_dnsupdate: Restore the --each option
mod_dnsupdate/mod_dnsupdate.lua
--- 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