From 273f34fc0051fae5a95d13414f939e599217739d Mon Sep 17 00:00:00 2001 From: Pierre-Louis Gottfrois Date: Tue, 13 Jun 2017 18:23:37 +0200 Subject: [PATCH] Fixes #206 by using psql port defined in env var --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index ed8b3aa0..a9d5ec52 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,7 +11,7 @@ check_database_connection() { ;; pgsql) prog="/usr/bin/pg_isready" - prog="${prog} -h ${DB_HOST} -U ${DB_USERNAME} -d ${DB_DATABASE} -t 1" + prog="${prog} -h ${DB_HOST} -p ${DB_PORT} -U ${DB_USERNAME} -d ${DB_DATABASE} -t 1" ;; esac timeout=60 @@ -45,7 +45,7 @@ checkdbinitmysql() { checkdbinitpsql() { table=sessions export PGPASSWORD=${DB_PASSWORD} - if [[ "$(psql -h ${DB_HOST} -U ${DB_USERNAME} -d ${DB_DATABASE} -c "SELECT to_regclass('${DB_PREFIX}${table}');" | grep -c "${DB_PREFIX}${table}")" -eq 1 ]]; then + if [[ "$(psql -h ${DB_HOST} -p ${DB_PORT} -U ${DB_USERNAME} -d ${DB_DATABASE} -c "SELECT to_regclass('${DB_PREFIX}${table}');" | grep -c "${DB_PREFIX}${table}")" -eq 1 ]]; then echo "Table ${DB_PREFIX}${table} exists! ..." else echo "Table ${DB_PREFIX}${table} does not exist! ..."