Comparison

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
parent 4764:a754f7e380b2
child 4779:6395d4732bc6
comparison
equal deleted inserted replaced
4764:a754f7e380b2 4765:3632836f35b0
102 print(("del _%s._tcp.%s IN SRV"):format(service, ihost)); 102 print(("del _%s._tcp.%s IN SRV"):format(service, ihost));
103 else 103 else
104 for _, rr in ipairs(records) do 104 for _, rr in ipairs(records) do
105 if ports:contains(rr.srv.port) and target == nameprep(rr.srv.target):gsub("%.$", "") then 105 if ports:contains(rr.srv.port) and target == nameprep(rr.srv.target):gsub("%.$", "") then
106 ports:remove(rr.srv.port) 106 ports:remove(rr.srv.port)
107 elseif not opts.each then
108 print(("del _%s._tcp.%s IN SRV"):format(service, ihost));
109 break
107 else 110 else
108 print(("del _%s._tcp.%s IN SRV %s"):format(service, ihost, rr)); 111 print(("del _%s._tcp.%s IN SRV %s"):format(service, ihost, rr));
109 end 112 end
110 end 113 end
111 end 114 end