Skip to content

Commit

Permalink
Removed unnecessary check for ssh_key value when installing ssh key
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvid Andersson committed Dec 15, 2011
1 parent a48c69b commit 7a08e6d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/teleport/install.rb
Expand Up @@ -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
Expand Down

0 comments on commit 7a08e6d

Please sign in to comment.