Skip to content

Instantly share code, notes, and snippets.

@nappa32
Forked from j3tm0t0/ec2ssh.sh
Created June 27, 2013 21:57
Show Gist options
  • Select an option

  • Save nappa32/5880755 to your computer and use it in GitHub Desktop.

Select an option

Save nappa32/5880755 to your computer and use it in GitHub Desktop.
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