From 1bc20e20671c50277a639db8f44ec57deb41b0fc Mon Sep 17 00:00:00 2001 From: Bohung Date: Fri, 19 Nov 2021 11:21:49 +0800 Subject: [PATCH] Fix bug. --- lib/tasks/change_site_cert.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/change_site_cert.rake b/lib/tasks/change_site_cert.rake index 0dafa4c..dc15484 100644 --- a/lib/tasks/change_site_cert.rake +++ b/lib/tasks/change_site_cert.rake @@ -33,7 +33,7 @@ namespace :create_site do Net::SSH.start(site_server.ip , site_server.account , password: site_server.password) do |ssh| if tmp_is_certbot || (@site_cert.is_certbot rescue false) domain_names = site_constructs.flat_map{|site_construct| site_construct.domain_name.strip.split(" ")}.select{|d| d.present? && d.match(/^[\d\.]+$/).nil?} - domain_names = domain_names.select{|d| `dig #{d} +short`.strip == site_server.ip} + domain_names = domain_names.select{|d| `dig #{d} +short`.split("\n").select{|s| s.strip == site_server.ip}.count != 0} if domain_names.count != 0 certbot_path = exec_ssh_command_by_sudo_and_see_output(ssh,"bash -l -c 'which certbot certbot-auto'",false,true).strip.split("\n")[0] if certbot_path.present?