This commit is contained in:
BoHung Chiu 2022-10-16 15:58:59 +08:00
parent 644aa05ee4
commit d26b93d039
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ namespace :create_site do
domain_names = site_constructs.flat_map{|site_construct| site_construct.domain_name.strip.split(" ")}.select{|d| d.present? && d.match(/^[\d\.]+$/).nil?} 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`.split("\n").select{|s| s.strip == site_server.ip}.count != 0} 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 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] certbot_path = exec_ssh_command_by_sudo_and_see_output(ssh,"bash -l -c 'which certbot certbot-auto'",false,true).strip.split("\n")[0].strip()
if certbot_path.present? if certbot_path.present?
auto_update_infos("Using certbot to update cert setting...") auto_update_infos("Using certbot to update cert setting...")
if site_constructs.count > 1 if site_constructs.count > 1