Sha256: ad3eebe29b6c016c11dd6b192d8c81df5de8537a443c543008f8032b1f5cb7d7

Contents?: true

Size: 689 Bytes

Versions: 3

Compression:

Stored size: 689 Bytes

Contents

# Copyright (c) 2014 Tnarik Innael - adaptation to Solaris and repackaging
# Copyright (c) 2014 Mitchell Hashimoto - from plugins/guest/linux/cap/remove_public_key.rb
module Vagrant
  module Solaris10
    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|
            if comm.test("test -f ~/.ssh/authorized_keys")
              comm.execute(
                "gsed -i '/^.*#{contents}.*$/d' ~/.ssh/authorized_keys")
            end
          end
        end
        
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-solaris10-0.0.4 lib/vagrant-solaris10/cap/remove_public_key.rb
vagrant-solaris10-0.0.3 lib/vagrant-solaris10/cap/remove_public_key.rb
vagrant-solaris10-0.0.2 lib/vagrant-solaris10/cap/remove_public_key.rb