From a4d7601b43e3d3ebd74a102b29ca51860730b31a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com>
Date: Mon, 10 Jul 2023 17:38:58 +0200
Subject: [PATCH] [FIX] error if db name contained in db user

---
 entrypoint.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/entrypoint.sh b/entrypoint.sh
index 5b77426..c6c31ca 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -36,7 +36,7 @@ while true; do
     sleep 1
 done
 
-if ! psql --list 2> /dev/null | grep $PGDATABASE > /dev/null 2>&1; then
+if ! psql --list --no-align --tuples-only 2> /dev/null | grep ^$PGDATABASE\| > /dev/null 2>&1; then
   	echo "Database $PGDATABASE does not exist"
   	DB_ARGS+=("--load-language")
   	DB_ARGS+=("fr_FR")
-- 
GitLab