When cleaning NFS, properly escape certain characters
This commit is contained in:
parent
0eef208d2d
commit
a53d569656
|
@ -89,6 +89,10 @@ module VagrantPlugins
|
||||||
def nfs_cleanup(id)
|
def nfs_cleanup(id)
|
||||||
return if !File.exist?("/etc/exports")
|
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
|
# Use sed to just strip out the block of code which was inserted
|
||||||
# by Vagrant, and restart NFS.
|
# by Vagrant, and restart NFS.
|
||||||
system("sudo sed -e '/^# VAGRANT-BEGIN: #{id}/,/^# VAGRANT-END: #{id}/ d' -ibak /etc/exports")
|
system("sudo sed -e '/^# VAGRANT-BEGIN: #{id}/,/^# VAGRANT-END: #{id}/ d' -ibak /etc/exports")
|
||||||
|
|
Loading…
Reference in New Issue