mirror of
https://github.com/cmur2/dyndnsd.git
synced 2025-07-01 22:30:19 +02:00
daemon: break extracting myip down into smaller parts
This commit is contained in:
@ -19,7 +19,7 @@ module Dyndnsd
|
||||
out << "@ IN NS #{@dns}"
|
||||
out << ""
|
||||
zone['hosts'].each do |hostname,ips|
|
||||
(ips.is_a?(Array) ? ips : [ips]).each do |ip|
|
||||
ips.each do |ip|
|
||||
ip = IPAddr.new(ip).native
|
||||
type = ip.ipv6? ? "AAAA" : "A"
|
||||
name = hostname.chomp('.' + @domain)
|
||||
|
@ -34,9 +34,8 @@ module Dyndnsd
|
||||
end
|
||||
end
|
||||
|
||||
def get_success_body(states, ip)
|
||||
ips = ip.is_a?(Array) ? ip.join(' ') : ip
|
||||
states.map { |state| "#{state} #{ips}" }.join("\n")
|
||||
def get_success_body(changes, myips)
|
||||
changes.map { |change| "#{change} #{myips.join(' ')}" }.join("\n")
|
||||
end
|
||||
|
||||
def get_error_response_map
|
||||
|
@ -34,10 +34,8 @@ module Dyndnsd
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def get_success_response(states, ip)
|
||||
ips = ip.is_a?(Array) ? ip.join(' ') : ip
|
||||
states.map { |state| state == :good ? "Changed to #{ips}" : "No change needed for #{ips}" }.join("\n")
|
||||
def get_success_body(changes, myips)
|
||||
changes.map { |change| change == :good ? "Changed to #{myips.join(' ')}" : "No change needed for #{myips.join(' ')}" }.join("\n")
|
||||
end
|
||||
|
||||
def get_error_response_map
|
||||
|
Reference in New Issue
Block a user