Skip to content

Instantly share code, notes, and snippets.

@taksatou
Created August 21, 2012 06:04
Show Gist options
  • Save taksatou/3412524 to your computer and use it in GitHub Desktop.
Save taksatou/3412524 to your computer and use it in GitHub Desktop.
ssh-aws
function ssh-aws() {
KEY=$1
NAME=$2
if which list_instances >/dev/null; then
CMD="ssh -i $KEY root@`list_instances $* -H T:Name,Hostname | awk '{ if ("'$NAME'"==¥$1) print ¥$2}'`"
echo $CMD
sh -c $CMD
else
echo please install boto;
return 1;
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment