gnu-social/docker/db/wait_for_db.sh

20 lines
297 B
Bash
Executable File

#!/bin/sh
case $SOCIAL_DBMS in
"mariadb")
CMD=mysqladmin ping --silent -hdb -uroot -p${MYSQL_ROOT_PASSWORD}
;;
"postgres")
CMD=su postgres && pg_isready -hdb -q
;;
*)
exit 1
esac
while ! $CMD;
do
echo "Waiting for DB..."
sleep 3
done