From 628165fd0a4e03bb7bbef3a464447924195e10b8 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 23 Oct 2012 03:53:06 -0700 Subject: added a bunch of new commands, including init-node and deploy --- lib/leap_cli/commands/user.rb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'lib/leap_cli/commands/user.rb') diff --git a/lib/leap_cli/commands/user.rb b/lib/leap_cli/commands/user.rb index 00c4b62..7be91c8 100644 --- a/lib/leap_cli/commands/user.rb +++ b/lib/leap_cli/commands/user.rb @@ -1,13 +1,14 @@ require 'gpgme' # -# notes: +# perhaps we want to verify that the key files are actually the key files we expect. +# we could use 'file' for this: # -# file ~/.gnupg/00440025.asc -# /home/elijah/.gnupg/00440025.asc: PGP public key block +# > file ~/.gnupg/00440025.asc +# ~/.gnupg/00440025.asc: PGP public key block # -# file ~/.ssh/id_rsa.pub -# /home/elijah/.ssh/id_rsa.pub: OpenSSH RSA public key +# > file ~/.ssh/id_rsa.pub +# ~/.ssh/id_rsa.pub: OpenSSH RSA public key # module LeapCli @@ -103,5 +104,13 @@ module LeapCli return `gpg --armor --export-options export-minimal --export #{key_id}`.strip end + def update_authorized_keys + buffer = StringIO.new + Dir.glob(path([:user_ssh, '*'])).each do |keyfile| + buffer << File.read(keyfile) + end + write_file!(:authorized_keys, buffer.string) + end + end end \ No newline at end of file -- cgit v1.2.3