Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed unnecessary check for ssh_key value when installing ssh key

  • Loading branch information...
commit 7a08e6dc2d79205260a9d289fc970685dc91ff37 1 parent a48c69b
Arvid Andersson authored
Showing with 6 additions and 8 deletions.
  1. +6 −8 lib/teleport/install.rb
View
14 lib/teleport/install.rb
@@ -167,14 +167,12 @@ def _create_user
end
# ssh key, if present
- if pubkey = @config.ssh_key
- if File.exists?(PUBKEY)
- authorized_keys = "/home/#{user}/.ssh/authorized_keys"
- if !File.exists?(authorized_keys)
- puts "adding #{File.basename(pubkey)} to authorized_keys..."
- mkdir_if_necessary(File.dirname(authorized_keys), user, 0700)
- cp(PUBKEY, authorized_keys, user, 0600)
- end
+ if File.exists?(PUBKEY)
+ authorized_keys = "/home/#{user}/.ssh/authorized_keys"
+ if !File.exists?(authorized_keys)
+ puts "adding #{File.basename(@config.ssh_key)} to authorized_keys..."
+ mkdir_if_necessary(File.dirname(authorized_keys), user, 0700)
+ cp(PUBKEY, authorized_keys, user, 0600)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.