Skip to content

Instantly share code, notes, and snippets.

@ichux
Last active May 21, 2025 11:35
Show Gist options
  • Save ichux/253b40b55c1033f0c5a9dc995d336b8d to your computer and use it in GitHub Desktop.
Save ichux/253b40b55c1033f0c5a9dc995d336b8d to your computer and use it in GitHub Desktop.
while ! (echo > /dev/tcp/localhost/3306) 2>/dev/null && echo "- 3306"; do sleep 1; done; echo "+ 3306"
# PostgreSQL
while ! PGPASSWORD="$PGPASSWORD" psql -h localhost -U "$PGUSER" -d "$PGDATABASE" -c '\q' 2>/dev/null; do
sleep 1
done
echo "PostgreSQL is ready"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment