Skip to content

Instantly share code, notes, and snippets.

@ticean
Created January 27, 2011 22:50
Show Gist options
  • Save ticean/799469 to your computer and use it in GitHub Desktop.
Save ticean/799469 to your computer and use it in GitHub Desktop.
Get a list of Scalr instances for a particular role.
#!/bin/bash
##############################################################
# Get a list of Scalr instances for a particular role.
#
# PARAMS:
# ROLE_NAME - The Scalr role name.
#
##############################################################
ROLE_NAME="$1"
BASE_PATH="/ect/scalr/private.d/hosts/"
ROLE_PATH="${BASE_PATH}${ROLE_NAME}"
if [ -d "$ROLE_PATH" ]; then
for instance in "$ROLE_PATH"/*; do
IP=${basename "$instance"}
echo $IP
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment