guests/linux: POSIX sed [GH-6104]
This commit is contained in:
parent
240c393e69
commit
f5cadc93fa
|
@ -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 New Issue