Created
October 19, 2016 20:39
-
-
Save josephdpurcell/edff84b1ccb09659df1f669beb84f06e to your computer and use it in GitHub Desktop.
Quick script to SSH into nova private IP
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
#!/bin/bash | |
# Example Usage: | |
# ./nova-ssh.sh ADM | |
# ./nova-ssh.sh APP001 | |
CACHED_LIST=~/.nova-list.txt | |
if [ ! -f "$CACHED_LIST" ] | |
then | |
touch "$CACHED_LIST" | |
nova list > "$CACHED_LIST" | |
fi | |
NOVA_SERVER_IP=`cat $CACHED_LIST | grep $1 | awk '{print $14}' | sed 's/private=//g'|head -n 1` | |
NOVA_SERVER_USER=$USER | |
ssh $NOVA_SERVER_USER@$NOVA_SERVER_IP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment