Skip to content

Instantly share code, notes, and snippets.

@josephdpurcell
Created October 19, 2016 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephdpurcell/edff84b1ccb09659df1f669beb84f06e to your computer and use it in GitHub Desktop.
Save josephdpurcell/edff84b1ccb09659df1f669beb84f06e to your computer and use it in GitHub Desktop.
Quick script to SSH into nova private IP
#!/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