Skip to content

Instantly share code, notes, and snippets.

@bjeanes
Last active May 23, 2016 15:36
Show Gist options
  • Select an option

  • Save bjeanes/9ff47f4438bfa121ce8f57f7a51884a8 to your computer and use it in GitHub Desktop.

Select an option

Save bjeanes/9ff47f4438bfa121ce8f57f7a51884a8 to your computer and use it in GitHub Desktop.
Attempt to add a Heroku labs feature to specified app(s) until
#!/usr/bin/env bash
### Attempt to add a Heroku labs feature to specified app(s) until success
# Originally created for limited availability `http-sni` to try to get in as allocation opened up.
# Call with ./labs-enable.sh <lab-feature> <app1> [<app2> ...]
feature=$1
enable_apps() {
if [ $# -gt 0 ]; then
echo "Attempting to enable $feature for $1"
until heroku labs:enable $feature -a $1; do
echo "[`date +"%H:%M:%S"`] Waiting 5 minutes..."
sleep 300 # 5 minutes
done
echo ""
echo ""
echo ""
shift
enable_apps $*
fi
}
shift
enable_apps $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment