Created
February 4, 2016 22:38
This file contains 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
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