diff --git a/docker/db/wait_for_db.sh b/docker/db/wait_for_db.sh index 712299cc67..40a879aaa3 100755 --- a/docker/db/wait_for_db.sh +++ b/docker/db/wait_for_db.sh @@ -1,12 +1,12 @@ #!/bin/sh case $DBMS in - "mariadb") - CMD="mysqladmin ping --silent -hdb -uroot -p${MYSQL_ROOT_PASSWORD}" - ;; "postgres") CMD="pg_isready -hdb -q -Upostgres" ;; + "mariadb") + CMD="mysqladmin ping --silent -hdb -uroot -p${MYSQL_ROOT_PASSWORD}" + ;; *) exit 1 esac diff --git a/docker/social/install.sh b/docker/social/install.sh index a4117086d8..a7044d89cb 100755 --- a/docker/social/install.sh +++ b/docker/social/install.sh @@ -1,11 +1,22 @@ #!/bin/sh -PGPASSWORD="${POSTGRES_PASSWORD}" psql -ltq -Upostgres -hdb | \ - cut -d '|' -f1 | grep -wq "${SOCIAL_DB}" +case "${DBMS}" in + 'postgres') + PGPASSWORD="${POSTGRES_PASSWORD}" psql -ltq -Upostgres -hdb | \ + cut -d '|' -f1 | grep -wq "${SOCIAL_DB}" + DB_EXISTS=$? + ;; + 'mariadb') + mysqlcheck -cqs -uroot -p${MYSQL_ROOT_PASSWORD} -hdb social 2> /dev/null + DB_EXISTS=$? + exit 1 + ;; + *) + echo "Unknown DBMS" + exit 1 +esac -if [ ! $? ]; then - - echo ${SOCIAL_DB} +if [ ! ${DB_EXISTS} ]; then echo -e "Installing GNU social\nInstalling composer dependencies"