skillbox/server/wait-for-postgres.sh

16 lines
226 B
Bash
Executable File

#!/bin/bash
# wait-for-postgres.sh
set -e
host="$1"
shift
cmd="$@"
until python check_connection.py; do
>&2 echo "Postgres is unavailable - sleeping"
sleep 1
done
>&2 echo "Postgres is up - executing command"
exec $cmd