From: Scott Baker Date: Tue, 12 Aug 2014 01:04:04 +0000 (-0700) Subject: sample script using get-instance-name X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=dea04a58e99a38905c7279d0041615917c9a489e;p=plstackapi.git sample script using get-instance-name --- diff --git a/planetstack/tools/ssh-myslice b/planetstack/tools/ssh-myslice new file mode 100755 index 0000000..b8f79d3 --- /dev/null +++ b/planetstack/tools/ssh-myslice @@ -0,0 +1,15 @@ +#! /bin/bash + +# Demonstrates using get_instance_name to ssh to an instance at a hostname +# Call this script with one argument, the name of the node you want to ssh + +# fill in all ow the following wiht your info + +$USERNAME=my_username +$PASSWORD=my_password +$SLICENAME=my_slice +$KEY=pathname_to_my_ssh_key +$PROGRAM=/home/smbaker/projects/vicci/plstackapi/planetstack/tools/get_instance_name.py + +INSTANCE_NAME=`python $PROGRAM $USERNAME $PASSWORD $1 $SLICENAME` +ssh-agent bash -c "ssh-add $KEY; ssh -A $INSTANCE_NAME@$1"