Skip to content

Instantly share code, notes, and snippets.

@sebastianrothbucher
Created October 25, 2015 12:38
Show Gist options
  • Save sebastianrothbucher/4d4fb23aef96810f8ad6 to your computer and use it in GitHub Desktop.
Save sebastianrothbucher/4d4fb23aef96810f8ad6 to your computer and use it in GitHub Desktop.
Wait 4 Postgres 2 be up and running
#!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