mirror of
https://github.com/cmur2/dyndnsd.git
synced 2024-10-09 17:02:21 +02:00
Supply IP to responder
This commit is contained in:
parent
b6bc37c042
commit
3a39f4fa0a
@ -81,10 +81,10 @@ module Dyndnsd
|
||||
@db['serial'] += 1
|
||||
@db.save
|
||||
update
|
||||
return @responder.response_for(:good)
|
||||
return @responder.response_for(:good, myip)
|
||||
end
|
||||
|
||||
@responder.response_for(:nochg)
|
||||
@responder.response_for(:nochg, myip)
|
||||
end
|
||||
|
||||
def self.run!
|
||||
|
@ -2,7 +2,7 @@
|
||||
module Dyndnsd
|
||||
module Responder
|
||||
class RestStyle
|
||||
def response_for(state)
|
||||
def response_for(state, ip = nil)
|
||||
# general http errors
|
||||
return [405, {"Content-Type" => "text/plain"}, ["Method Not Allowed"]] if state == :method_forbidden
|
||||
return [404, {"Content-Type" => "text/plain"}, ["Not Found"]] if state == :not_found
|
||||
@ -11,8 +11,8 @@ module Dyndnsd
|
||||
return [403, {"Content-Type" => "text/plain"}, ["Forbidden"]] if state == :host_forbidden
|
||||
return [422, {"Content-Type" => "text/plain"}, ["Hostname malformed"]] if state == :hostname_malformed
|
||||
# OKs
|
||||
return [200, {"Content-Type" => "text/plain"}, ["Good"]] if state == :good
|
||||
return [200, {"Content-Type" => "text/plain"}, ["No change"]] if state == :nochg
|
||||
return [200, {"Content-Type" => "text/plain"}, ["Changed to #{ip}"]] if state == :good
|
||||
return [200, {"Content-Type" => "text/plain"}, ["No change needed for #{ip}"]] if state == :nochg
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user