This repository has been archived on 2023-01-26. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
automate/docker/images/wait-for-postgres/wait-for-postgres.sh
T
2022-09-07 23:25:26 +02:00

12 lines
226 B
Bash

#!/bin/sh
set -e
until psql -h "$POSTGRES_HOST" -U "$POSTGRES_USERNAME" -d "$POSTGRES_HOST" -c '\q'; do
>&2 echo "Postgres is unavailable - sleeping"
sleep 1
done
>&2 echo "Postgres is up - executing command"
exec "$@"