Sha256: 8b5b07a004ba761d5f45f6e42c3c6ed0ca0c9833e4b6ec546f1a846196f6af54
Contents?: true
Size: 584 Bytes
Versions: 7
Compression:
Stored size: 584 Bytes
Contents
require "vagrant/util/shell_quote" module VagrantPlugins module GuestOpenWrt 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 if test -f /etc/dropbear/authorized_keys ; then sed -i '/^.*#{contents}.*$/d' /etc/dropbear/authorized_keys fi EOH end end end end end end
Version data entries
7 entries across 7 versions & 2 rubygems