Merge pull request #6565 from mitchellh/b-posix-sed
guests/linux: POSIX sed [GH-6104]
This commit is contained in:
commit
82fa09ca87
|
@ -10,8 +10,10 @@ module VagrantPlugins
|
||||||
|
|
||||||
machine.communicate.tap do |comm|
|
machine.communicate.tap do |comm|
|
||||||
if comm.test("test -f ~/.ssh/authorized_keys")
|
if comm.test("test -f ~/.ssh/authorized_keys")
|
||||||
comm.execute(
|
comm.execute(<<SCRIPT)
|
||||||
"sed -i '/^.*#{contents}.*$/d' ~/.ssh/authorized_keys")
|
sed -e '/^.*#{contents}.*$/d' ~/.ssh/authorized_keys > ~/.ssh/authorized_keys.new
|
||||||
|
mv ~/.ssh/authorized_keys.new ~/.ssh/authorized_keys
|
||||||
|
SCRIPT
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue