Sha256: 8d455e2ab549f2bc54d9a667a26efe20a256d02d051e030b5c8516776f34de03

Contents?: true

Size: 877 Bytes

Versions: 2

Compression:

Stored size: 877 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

2 entries across 2 versions & 1 rubygems

Version Path
auser-poolparty-0.2.88 bin/cloud-add-access
auser-poolparty-0.2.89 bin/cloud-add-access