Skip to content

Instantly share code, notes, and snippets.

@bthelen
Last active May 17, 2018 18:26
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 bthelen/6c4308260d2b46efbbbbe5665757b610 to your computer and use it in GitHub Desktop.
Save bthelen/6c4308260d2b46efbbbbe5665757b610 to your computer and use it in GitHub Desktop.
#! /usr/bin/env bash
function waitForServicesToInitialize() {
# Wait until services are ready
while cf services | grep 'create in progress'
do
sleep 10
echo "Waiting for services to initialize..."
done
# Check to see if any services failed to create
if cf services | grep 'create failed'; then
echo "Service initialization - failed. Exiting."
return 1
fi
echo "Service initialization - successful"
}
waitForServicesToInitialize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment