14 lines
219 B
Bash
Executable file
14 lines
219 B
Bash
Executable file
#!/bin/sh
|
|
|
|
host="$1"
|
|
port="$2"
|
|
shift 2
|
|
cmd="$@"
|
|
|
|
until nc -z -v -w1 "$host" "$port"; do
|
|
>&2 echo "PostgreSQL is unavailable - sleeping"
|
|
sleep 5
|
|
done
|
|
|
|
>&2 echo "PostgreSQL is up - executing startup sequence"
|
|
exec $cmd
|