2020-05-05 02:23:55 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-05-06 13:04:59 +01:00
|
|
|
case $DBMS in
|
2020-05-05 02:23:55 +01:00
|
|
|
"postgres")
|
2020-05-06 16:32:07 +01:00
|
|
|
CMD="pg_isready -hdb -q -Upostgres"
|
2020-05-05 02:23:55 +01:00
|
|
|
;;
|
2020-05-06 17:03:48 +01:00
|
|
|
"mariadb")
|
|
|
|
CMD="mysqladmin ping --silent -hdb -uroot -p${MYSQL_ROOT_PASSWORD}"
|
|
|
|
;;
|
2020-05-05 02:23:55 +01:00
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
while ! $CMD;
|
|
|
|
do
|
|
|
|
echo "Waiting for DB..."
|
|
|
|
sleep 3
|
|
|
|
done
|