Skip to content

Commit

Permalink
Merge pull request mm53bar#11 from MarkBennett/only-run-on-running-in…
Browse files Browse the repository at this point in the history
…stances

Ignore any EC2 instances that are not running
  • Loading branch information
mm53bar committed Apr 9, 2013
2 parents f943af2 + 5c7df5c commit ef4ccd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/plow
Expand Up @@ -85,7 +85,7 @@ else
INSTANCE_NAMES=($(echo "${DESCRIBE_TAG}" | grep TAG | awk {'print $3'})) INSTANCE_NAMES=($(echo "${DESCRIBE_TAG}" | grep TAG | awk {'print $3'}))


for instance in ${INSTANCE_NAMES[@]}; do for instance in ${INSTANCE_NAMES[@]}; do
DESCRIBE_INSTANCE=$(ec2-describe-instances $instance) DESCRIBE_INSTANCE=$(ec2-describe-instances --filter "instance-state-name=running" $instance)
SERVERS[${#SERVERS[@]}]=$(echo ${DESCRIBE_INSTANCE} | sed -E 's/RESERVATION.*ami-.{9}//' | sed -E 's/\ .*//') SERVERS[${#SERVERS[@]}]=$(echo ${DESCRIBE_INSTANCE} | sed -E 's/RESERVATION.*ami-.{9}//' | sed -E 's/\ .*//')
done done
fi fi
Expand Down

0 comments on commit ef4ccd6

Please sign in to comment.