Use $POSTGRES_USER environment variable

This commit is contained in:
Ben 2020-05-07 17:28:53 +01:00
parent 865dba23ff
commit 8e90f8ec88

View File

@ -7,7 +7,7 @@ host="$1"
shift
cmd="$@"
until PGPASSWORD=$POSTGRES_PASSWORD psql -h "$host" -U "postgres" -c '\q'; do
until PGUSER=$POSTGRES_USER PGPASSWORD=$POSTGRES_PASSWORD psql -h "$host" -c '\q'; do
>&2 echo "Postgres is unavailable - sleeping"
sleep 1
done