Skip to content

Instantly share code, notes, and snippets.

@ehazlett
Created April 15, 2015 18:04
Show Gist options
  • Save ehazlett/c7aa3e13c40723ab31eb to your computer and use it in GitHub Desktop.
Save ehazlett/c7aa3e13c40723ab31eb to your computer and use it in GitHub Desktop.
#!/bin/bash
ACTION=${1:-}
PROVIDER=${2:-}
INSTANCES=${3:-10}
LOG=gun.log
truncate -s0 $LOG
if [ -z "$ACTION" ]; then
echo "Usage: $0 <create|rm> <provider> [# of instances]"
exit 1
fi
for i in $(seq 1 $INSTANCES); do
if [ "$ACTION" = "create" ]; then
docker-machine -D create -d $PROVIDER mgun-$PROVIDER-$i >> $LOG 2>&1 &
elif [ "$ACTION" = "rm" ]; then
docker-machine -D rm mgun-$PROVIDER-$i >> $LOG 2>&1 &
else
echo "Unknown action: $ACTION"
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment