Skip to content

Instantly share code, notes, and snippets.

@JesseHerrick
Last active December 30, 2015 22:28
Show Gist options
  • Save JesseHerrick/7894135 to your computer and use it in GitHub Desktop.
Save JesseHerrick/7894135 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [ -f $HOME/.zshrc ]
then
SHELL_INIT="$HOME/.zshrc"
elif [ -f $HOME/.bashrc ]
then
SHELL_INIT="~/.bashrc"
elif [ -f $HOME/.bash_profile ]
then
SHELL_INIT="$HOME/.bash_profile"
else
echo "No shell init!"
fi
username="ec2_user"
# Get input for IP and Username
echo "AWS Username [default: ec2_user]: "
read username
echo "AWS IP: "
read ip
LOGIN="$ip"
# Append an alias for logging in to SSH.
echo "alias aws='ssh -i ~/.ssh/BukkitKey.pem $LOGIN'" >> $SHELL_INIT
# Now login...
aws
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment