2023-11-21 04:10:40 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
host="$1"
|
|
|
|
port="$2"
|
|
|
|
shift 2
|
|
|
|
cmd="$@"
|
|
|
|
|
|
|
|
until nc -z -v -w1 "$host" "$port"; do
|
2024-07-02 19:21:36 +00:00
|
|
|
>&2 echo "PostgreSQL is unavailable - sleeping"
|
|
|
|
sleep 5
|
2023-11-21 04:10:40 +00:00
|
|
|
done
|
|
|
|
|
2024-07-02 19:21:36 +00:00
|
|
|
>&2 echo "PostgreSQL is up - executing startup sequence"
|
2023-11-21 04:10:40 +00:00
|
|
|
exec $cmd
|