From dec3a7f7894f4152270c69fff71b812d7d047e08 Mon Sep 17 00:00:00 2001 From: hoellen Date: Wed, 27 Dec 2023 11:11:03 +0100 Subject: [PATCH] fix: set default port for PostgreSQL in db check --- rootfs/usr/local/bin/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rootfs/usr/local/bin/run.sh b/rootfs/usr/local/bin/run.sh index 5f66720..c0e66fe 100644 --- a/rootfs/usr/local/bin/run.sh +++ b/rootfs/usr/local/bin/run.sh @@ -17,7 +17,8 @@ fi # Check if database is available if [ -n "${DB_TYPE}" ] && [ "${DB_TYPE}" != "sqlite3" ]; then - until nc -z "${DB_HOST:-nextcloud-db}" "${DB_PORT:-3306}" + DB_PORT=${DB_PORT:-$( [ "${DB_TYPE}" = "pgsql" ] && echo 5432 || echo 3306 )} + until nc -z "${DB_HOST:-nextcloud-db}" "${DB_PORT}" do echo "waiting for the database container..." sleep 1