diff --git a/lib/tasks/detect_sites.rake b/lib/tasks/detect_sites.rake index 0dbfcf3..b56f080 100644 --- a/lib/tasks/detect_sites.rake +++ b/lib/tasks/detect_sites.rake @@ -148,7 +148,7 @@ namespace :create_site do FileUtils.mkdir_p(File.dirname(cert_file_store_path)) unless Dir.exist?(File.dirname(cert_file_store_path)) File.open(cert_file_store_path,'w+'){|f| f.write(crt_file_content)} site_cert.cert_file.retrieve_from_store!(File.basename(cert_file_store_path)) - private_key_store_path = "public/#{site_cert.cert_file.store_dir}/#{File.basename(private_key_path)}" + private_key_store_path = "public/#{site_cert.private_key.store_dir}/#{File.basename(private_key_path)}" private_key_content = exec_ssh_command_by_sudo_and_see_output(ssh,"cat #{private_key_path}",false).select{|s| s.present?}.join("\n").strip.split(/(\r\n|\n)/).select{|s| s.present?}.join("\n") FileUtils.mkdir_p(File.dirname(private_key_store_path)) unless Dir.exist?(File.dirname(private_key_store_path)) File.open(private_key_store_path,'w+'){|f| f.write(private_key_content)}