From edf4738b06bd73ffecbf8a5343d718a34327961a Mon Sep 17 00:00:00 2001 From: bohung Date: Mon, 15 Mar 2021 14:13:12 +0800 Subject: [PATCH] Fix bug. --- lib/tasks/copy_site.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/copy_site.rake b/lib/tasks/copy_site.rake index 303efbb..d278fbe 100644 --- a/lib/tasks/copy_site.rake +++ b/lib/tasks/copy_site.rake @@ -67,8 +67,8 @@ namespace :create_site do exec_ssh_command_for_create(ssh,"sudo -p 'sudo password:' apt-get install -y sshpass") outputs = exec_ssh_command_for_create(ssh,"sshpass -p \"#{server.password}\" rsync -arv --delete --exclude={tmp/cache/,tmp/unicorn.sock,tmp/pids/*} #{server.account}@#{server.ip}:#{template_site.path}/#{template_site.get_site_name}/ #{args.path}/#{@site_construct.get_site_name}/",true) if outputs.join("\n").include?("Host key verification failed") - exec_ssh_command_by_sudo_for_create(session,"ssh-keygen -f \"$HOME/.ssh/known_hosts\" -R #{server.ip}") - exec_ssh_command_by_sudo_for_create(session,"ssh-keyscan -H #{server.ip} >> ~/.ssh/known_hosts") + exec_ssh_command_by_sudo_for_create(ssh,"ssh-keygen -f \"$HOME/.ssh/known_hosts\" -R #{server.ip}") + exec_ssh_command_by_sudo_for_create(ssh,"ssh-keyscan -H #{server.ip} >> ~/.ssh/known_hosts") exec_ssh_command_for_create(ssh,"sshpass -p \"#{server.password}\" rsync -arv --delete --exclude={tmp/cache/,tmp/unicorn.sock,tmp/pids/*} #{server.account}@#{server.ip}:#{template_site.path}/#{template_site.get_site_name}/ #{args.path}/#{@site_construct.get_site_name}/",true) end end