Created
October 25, 2015 12:38
-
-
Save sebastianrothbucher/4d4fb23aef96810f8ad6 to your computer and use it in GitHub Desktop.
Wait 4 Postgres 2 be up and running
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bash | |
export PGPASSWORD=testpw #fill in no-priv PW | |
wt=0 | |
while [ true ] | |
do | |
psql -U vaadin -c 'select * from dual' #create dual | |
if [ $? = 0 ] | |
then | |
echo "all is OK" | |
break | |
fi | |
wt=$(expr $wt + 5) | |
if [ $wt -gt 60 ] | |
then | |
echo "Timeout passed" | |
exit 1 | |
fi | |
echo "Wait another 5s" | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment