fix host file management to be windows and linux compatible
This commit is contained in:
parent
c2637f6f78
commit
84d2f9e4be
|
@ -41,11 +41,11 @@ module VagrantPlugins
|
||||||
|
|
||||||
if update_file(file, machine, false, line_endings)
|
if update_file(file, machine, false, line_endings)
|
||||||
# upload modified file and remove temporary file
|
# upload modified file and remove temporary file
|
||||||
machine.communicate.upload(file.to_s, "/tmp/hosts/hosts.#{machine.name}")
|
machine.communicate.upload(file.to_s, "/tmp/hosts.#{machine.name}")
|
||||||
if windir
|
if windir
|
||||||
machine.communicate.sudo("mv -force /tmp/hosts/hosts.#{machine.name} #{realhostfile}")
|
machine.communicate.sudo("mv -force /tmp/hosts.#{machine.name} #{realhostfile}")
|
||||||
else
|
else
|
||||||
machine.communicate.sudo("cat /tmp/hosts > #{realhostfile}")
|
machine.communicate.sudo("cat /tmp/hosts.#{machine.name} > #{realhostfile} && rm /tmp/hosts.#{machine.name}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue