Created
April 10, 2013 15:55
-
-
Save j3tm0t0/5355904 to your computer and use it in GitHub Desktop.
ec2ssh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ec2ssh | |
| { | |
| instance=$1 | |
| host=`ec2-describe-instances $1 | grep ^INSTANCE | cut -f 4` | |
| if [ "$host" = "" ] | |
| then | |
| host=`ec2-describe-instances $1 | grep ^INSTANCE | cut -f 17` | |
| fi | |
| if [ "$host" = "" ] | |
| then | |
| host=`ec2-describe-instances $1 | grep ^INSTANCE | cut -f 18` | |
| fi | |
| ssh -o "StrictHostKeyChecking no" ec2-user@$host $2 $3 $4 $5 $5 $6 $7 $8 $9 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment