Sha256: 47132af7c791291cd6f4e7892b562187f15d2015ed2ff3cacbc33066e5a66f85
Contents?: true
Size: 396 Bytes
Versions: 18
Compression:
Stored size: 396 Bytes
Contents
module ChefVPCToolkit module SshUtil def self.remove_known_hosts_ip(ip, known_hosts_file=File.join(ENV['HOME'], ".ssh", "known_hosts")) return if ip.nil? or ip.empty? existing=IO.read(known_hosts_file) File.open(known_hosts_file, 'w') do |file| existing.each_line do |line| if not line =~ Regexp.new("^#{ip}.*$") then file.write(line) end end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems