mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-05-28 04:36:05 -04:00
Merge pull request #6565 from mitchellh/b-posix-sed
guests/linux: POSIX sed [GH-6104]
This commit is contained in:
commit
82fa09ca87
1 changed files with 4 additions and 2 deletions
|
|
@ -10,8 +10,10 @@ module VagrantPlugins
|
|||
|
||||
machine.communicate.tap do |comm|
|
||||
if comm.test("test -f ~/.ssh/authorized_keys")
|
||||
comm.execute(
|
||||
"sed -i '/^.*#{contents}.*$/d' ~/.ssh/authorized_keys")
|
||||
comm.execute(<<SCRIPT)
|
||||
sed -e '/^.*#{contents}.*$/d' ~/.ssh/authorized_keys > ~/.ssh/authorized_keys.new
|
||||
mv ~/.ssh/authorized_keys.new ~/.ssh/authorized_keys
|
||||
SCRIPT
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue