diff --git a/plugins/hosts/bsd/host.rb b/plugins/hosts/bsd/host.rb index 5921901c4..0aee78f48 100644 --- a/plugins/hosts/bsd/host.rb +++ b/plugins/hosts/bsd/host.rb @@ -89,6 +89,10 @@ module VagrantPlugins def nfs_cleanup(id) return if !File.exist?("/etc/exports") + # Escape sed-sensitive characters: + id = id.gsub("/", "\\/") + id = id.gsub(".", "\\.") + # 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")