def update
if @updated == nil then
Net::HTTP.start(@main_options.get_option("update_server")) { |http|
update_string = String.new
@wanted_update.get_hash.each_key { |key|
if @valid_update.get_hash.has_key? key
update_string = update_string + "&" + key + "=" + @wanted_update.get_option(key)
end
}
update_string = update_string + "&" + @main_options.get_option("update_option_ip") + "=" + @ip.ip
if @main_options.get_option("auth") == "url" then
update_string = update_string + "&username=" + @conf.get_option("username") + "&password=" + @conf.get_option("password")
end
req = Net::HTTP::Get.new(@main_options.get_option("update_url") + update_string, {'User-Agent' => 'rddc-0.1'})
if @main_options.get_option("auth") == "base64" then
req.basic_auth @conf.get_option("username"), @conf.get_option("password")
end
response = http.request(req)
@updated = response.body
}
end
return @updated
end