From 5a258efdca300d916efb6fb4b9a88e076eca346e Mon Sep 17 00:00:00 2001 From: Bram Gotink Date: Tue, 28 May 2024 22:02:28 +0200 Subject: [PATCH] Fix shell syntax for parameter (#1041) The used syntax tries to call a non-existent `database_init_file` command: ``` Update password for user ... ALTER ROLE Create Database ... /entrypoint.sh: line 59: database_init_file: command not found Update User Privileges on Database ... GRANT ``` --- apps/postgres-init/entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/postgres-init/entrypoint.sh b/apps/postgres-init/entrypoint.sh index 3e1f345c7..eab9cca1f 100755 --- a/apps/postgres-init/entrypoint.sh +++ b/apps/postgres-init/entrypoint.sh @@ -56,12 +56,12 @@ for dbname in ${INIT_POSTGRES_DBNAME}; do printf "\e[1;32m%-6s\e[m\n" "Create Database ${dbname} ..." createdb --owner "${INIT_POSTGRES_USER}" "${dbname}" database_init_file="/initdb/${dbname}.sql" - if [[ -f "$(database_init_file)" ]]; then + if [[ -f "${database_init_file}" ]]; then printf "\e[1;32m%-6s\e[m\n" "Initialize Database ..." psql \ --dbname "${dbname}" \ --echo-all \ - --file "$(database_init_file)" + --file "${database_init_file}" fi fi printf "\e[1;32m%-6s\e[m\n" "Update User Privileges on Database ..."