Skip to content

Instantly share code, notes, and snippets.

@taksatou
Created August 21, 2012 06:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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