Skip to content

Instantly share code, notes, and snippets.

@taksatou
Created Aug 21, 2012
Embed
What would you like to do?
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