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