aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/shell.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2012-10-23 03:53:06 -0700
committerelijah <elijah@riseup.net>2012-10-23 03:53:06 -0700
commit628165fd0a4e03bb7bbef3a464447924195e10b8 (patch)
tree746280b6f4d6d488fcece4fff41b4addfb77d0c1 /lib/leap_cli/commands/shell.rb
parent4f38e99c629f60d9524d1cf23efa7ab927ac9cf4 (diff)
downloadleap_cli-628165fd0a4e03bb7bbef3a464447924195e10b8.tar.gz
leap_cli-628165fd0a4e03bb7bbef3a464447924195e10b8.tar.bz2
added a bunch of new commands, including init-node and deploy
Diffstat (limited to 'lib/leap_cli/commands/shell.rb')
-rw-r--r--lib/leap_cli/commands/shell.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/leap_cli/commands/shell.rb b/lib/leap_cli/commands/shell.rb
new file mode 100644
index 0000000..df392bd
--- /dev/null
+++ b/lib/leap_cli/commands/shell.rb
@@ -0,0 +1,12 @@
+module LeapCli; module Commands
+
+ desc 'Log in to the specified node with an interactive shell'
+ arg_name '<node-name>', :optional => false, :multiple => false
+ command :shell, :ssh do |c|
+ c.action do |global_options,options,args|
+ node = get_node_from_args(args)
+ exec "ssh -l root -o 'HostName=#{node.ip_address}' -o 'HostKeyAlias=#{node.name}' -o 'UserKnownHostsFile=#{path(:known_hosts)}' -o 'StrictHostKeyChecking=yes' #{node.name}"
+ end
+ end
+
+end; end \ No newline at end of file