Sha256: 39b95a904af41ee5bed581b702066929fd0fc149f47db45d1010cd3e7aeea9d3

Contents?: true

Size: 876 Bytes

Versions: 6

Compression:

Stored size: 876 Bytes

Contents

#!/usr/bin/env ruby
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "poolparty"
require "poolpartycl"

o = PoolParty::Optioner.new(ARGV, {:extra_help => "\nUsage: cloud [options] add-access file\n\n"}) do |opts, optioner|
  opts.on('-n name', '--name name', 'Listing for cloud name')    { |c| optioner.cloudname c }
  opts.on('-i num', '--id num', 'Instance num to ssh (default: 0)')    { |i| optioner.num i }
end

@instance_number = (o.num || 0 ).to_i

if o.unflagged_args.length > 1
  @file = o.unflagged_args.pop
else
  puts header("Error")
  puts "usage: \nUsage: cloud [options] add-access file\n\n"
end

o.loaded_clouds.each do |cloud|
  
  with_cloud(cloud, {:rsa_file=>@file }) do
    # Add access here
    cmd = "cat #{rsa_file} | #{ssh_command(master)} 'cat >> ~/.ssh/authorized_keys'"
    vputs "Running #{cmd}"
    Kernel.system cmd
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
auser-poolparty-0.2.90 bin/cloud-add-access
auser-poolparty-0.2.91 bin/cloud-add-access
auser-poolparty-0.2.92 bin/cloud-add-access
auser-poolparty-0.2.93 bin/cloud-add-access
auser-poolparty-0.2.94 bin/cloud-add-access
auser-poolparty-1.0.0 bin/cloud-add-access