diff --git a/lib/vagrant/hosts/bsd.rb b/lib/vagrant/hosts/bsd.rb index 0e8c85800..da79a3422 100644 --- a/lib/vagrant/hosts/bsd.rb +++ b/lib/vagrant/hosts/bsd.rb @@ -56,14 +56,10 @@ module Vagrant return if !File.exist?("/etc/exports") retryable(:tries => 10, :on => TypeError) do - system("cat /etc/exports | grep 'VAGRANT-BEGIN: #{id}' > /dev/null 2>&1") - - if $?.to_i == 0 - # Use sed to just strip out the block of code which was inserted - # by Vagrant, and restart NFS. - system("sudo sed -e '/^# VAGRANT-BEGIN: #{id}/,/^# VAGRANT-END: #{id}/ d' -ibak /etc/exports") - system(@nfs_restart_command) - end + # Use sed to just strip out the block of code which was inserted + # by Vagrant, and restart NFS. + system("sudo sed -e '/^# VAGRANT-BEGIN: #{id}/,/^# VAGRANT-END: #{id}/ d' -ibak /etc/exports") + system(@nfs_restart_command) end end end diff --git a/lib/vagrant/hosts/linux.rb b/lib/vagrant/hosts/linux.rb index f7107d2cf..c6e4a755d 100644 --- a/lib/vagrant/hosts/linux.rb +++ b/lib/vagrant/hosts/linux.rb @@ -52,13 +52,10 @@ module Vagrant def nfs_cleanup(id) return if !File.exist?("/etc/exports") - system("cat /etc/exports | grep 'VAGRANT-BEGIN: #{id}' > /dev/null 2>&1") - if $?.to_i == 0 - # Use sed to just strip out the block of code which was inserted - # by Vagrant - system("sudo sed -e '/^# VAGRANT-BEGIN: #{id}/,/^# VAGRANT-END: #{id}/ d' -ibak /etc/exports") - end + # Use sed to just strip out the block of code which was inserted + # by Vagrant + system("sudo sed -e '/^# VAGRANT-BEGIN: #{id}/,/^# VAGRANT-END: #{id}/ d' -ibak /etc/exports") end end end