mirror of
https://github.com/solero/wand.git
synced 2024-11-21 21:17:22 +00:00
Upload wait-for-postgres.sh
This commit is contained in:
parent
4d08d8f519
commit
6e99fd1ad1
16
wait-for-postgres.sh
Executable file
16
wait-for-postgres.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# wait-for-postgres.sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
host="$1"
|
||||||
|
shift
|
||||||
|
cmd="$@"
|
||||||
|
|
||||||
|
until PGPASSWORD=$POSTGRES_PASSWORD psql -h "$host" -U "postgres" -c '\q'; do
|
||||||
|
>&2 echo "Postgres is unavailable - sleeping"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
>&2 echo "Postgres is up - executing command"
|
||||||
|
exec $cmd
|
Loading…
Reference in New Issue
Block a user