ssl.sync_close = true
ssl.hostname = domains.first
ssl.connect
-rescue StandardError => error
- puts "Error connecting to #{host}: #{error.message}"
+rescue StandardError => e
+ puts "Error connecting to #{host}: #{e.message}"
end
if ssl
puts "Certificate #{domains.first} on #{host} expires at #{certificate.not_after}"
end
- subject_alt_name = certificate.extensions.find { |e| e.oid == "subjectAltName" }
+ subject_alt_name = certificate.extensions.find { |ext| ext.oid == "subjectAltName" }
if subject_alt_name.nil?
puts "Certificate #{domains.first} on #{host} has no subjectAltName"
fl.flock(File::LOCK_UN)
rescue StandardError
- STDERR.puts("Error! Couldn't update state.")
+ warn "Error! Couldn't update state."
fl.flock(File::LOCK_UN)
raise
end
rep = Replicator.new(ARGV[0])
rep.save!
rescue StandardError => e
- STDERR.puts "ERROR: #{e.message}"
+ warn "ERROR: #{e.message}"
exit 1
end