Last active
December 30, 2015 22:28
-
-
Save JesseHerrick/7894135 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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