Sha256: 223b8ed7f8643a516eb91ce954399b787b42693c934056fd725d1f13fd0b2ea0
Contents?: true
Size: 756 Bytes
Versions: 46
Compression:
Stored size: 756 Bytes
Contents
require "vagrant/util/shell_quote" module VagrantPlugins module GuestSmartos module Cap class RemovePublicKey def self.remove_public_key(machine, contents) contents = contents.chomp contents = Vagrant::Util::ShellQuote.escape(contents, "'") machine.communicate.tap do |comm| comm.execute <<-EOH.sub(/^ */, '') if test -f /usbkey/config.inc/authorized_keys ; then sed -i '' '/^.*#{contents}.*$/d' /usbkey/config.inc/authorized_keys fi if test -f ~/.ssh/authorized_keys ; then sed -i '' '/^.*#{contents}.*$/d' ~/.ssh/authorized_keys fi EOH end end end end end end
Version data entries
46 entries across 42 versions & 5 rubygems