fix error
This commit is contained in:
parent
2a2ed90114
commit
9263290fee
|
@ -10,7 +10,7 @@ namespace :create_site do
|
||||||
@password = site_server.password
|
@password = site_server.password
|
||||||
Net::SSH.start(site_server.ip , site_server.account , password: site_server.password) do |ssh|
|
Net::SSH.start(site_server.ip , site_server.account , password: site_server.password) do |ssh|
|
||||||
nginx_file_content = exec_command_by_user(ssh,"cat #{site_construct.nginx_file}")
|
nginx_file_content = exec_command_by_user(ssh,"cat #{site_construct.nginx_file}")
|
||||||
nginx_file_content = nginx_file_content.gsub(/^[ \t]*server_name[ \t]+.*;/," server_name #{args.server_name};").gsub('$','\$')
|
nginx_file_content = nginx_file_content.gsub(/^[ \t]*server_name[ \t]+.*;/," server_name #{args.server_name};")
|
||||||
puts nginx_file_content
|
puts nginx_file_content
|
||||||
cmd = "x='#{nginx_file_content}'; echo '#{@password}' | sudo -S sh -c \"echo '$x' > #{site_construct.nginx_file}\""
|
cmd = "x='#{nginx_file_content}'; echo '#{@password}' | sudo -S sh -c \"echo '$x' > #{site_construct.nginx_file}\""
|
||||||
exec_command_by_user(ssh,cmd)
|
exec_command_by_user(ssh,cmd)
|
||||||
|
|
Loading…
Reference in New Issue