Use 'tee' to write to /etc/exports

This commit is contained in:
Jon Topper 2014-05-05 23:55:16 +01:00
parent 958684fd7e
commit e5490544d6
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ module VagrantPlugins
# Output the rendered template into the exports # Output the rendered template into the exports
output.split("\n").each do |line| output.split("\n").each do |line|
line = Vagrant::Util::ShellQuote.escape(line, "'") line = Vagrant::Util::ShellQuote.escape(line, "'")
system("sudo", "-s", "--", "echo '#{line}' >> /etc/exports") system("echo '#{line}' | sudo tee -a /etc/exports >/dev/null")
end end
# We run restart here instead of "update" just in case nfsd # We run restart here instead of "update" just in case nfsd