Skip to content

Instantly share code, notes, and snippets.

@tpsrep0rts
Created February 4, 2016 22:38
Show Gist options
  • Save tpsrep0rts/86feddff211dd0dcfd4e to your computer and use it in GitHub Desktop.
Save tpsrep0rts/86feddff211dd0dcfd4e to your computer and use it in GitHub Desktop.
Add these to: ~/.bash_profile
function getServerIp() {
SERVER_NAME="$1"
grep "^$SERVER_NAME," ~/servers/ips | awk -F, '{ print $2 }'
}
function ssh_connect() {
IP=$(getServerIp "$1")
if [ -z "$IP" ]; then
IP=$1".novoed.com"
fi
ssh ec2-user@$IP
}
Add the following to ~/servers/ips
stage1,54.157.55.124
stage2,54.166.189.135
stagetask,54.204.138.243
prodtask,107.22.32.100
prodmemcache,184.73.45.204
prodsphinx,23.22.28.214
jenkinsslave,54.242.198.90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment