Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
shell script for starting and logging onto an ec2 instance
#!/bin/bash
secGroup="sg-50681d39"
ami="ami-1aad5273"
keyName="ec2ApiTools"
keyLocation="/home/jal/Documents/AWS/ec2ApiTools_rsa_id"
instance_id=$(ec2-run-instances -k $keyName -g $secGroup -t m1.large $ami | awk '/INSTANCE/{print $2}')
echo $instance_id
sleep 30
name=$(ec2-describe-instances $instance_id | awk '/INSTANCE/{print $4}')
echo $name
ssh -i $keyLocation ubuntu@$name -o StrictHostKeyChecking=no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.