From 200561d724435d6eef2307c4b9b97ebfe9acadd4 Mon Sep 17 00:00:00 2001 From: spatialgeobyte <158478685+spatialgeobyte@users.noreply.github.com> Date: Sat, 16 Mar 2024 21:32:35 +0200 Subject: [PATCH] fix #463 --- scripts/setup-user.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/setup-user.sh b/scripts/setup-user.sh index f5a017b8..293fa82c 100644 --- a/scripts/setup-user.sh +++ b/scripts/setup-user.sh @@ -7,9 +7,14 @@ source /scripts/env-data.sh # Check user already exists role_check "$POSTGRES_USER" -su - postgres -c "psql postgres -c \"$COMMAND USER $POSTGRES_USER WITH SUPERUSER ENCRYPTED PASSWORD '$POSTGRES_PASS';\"" - +STATEMENT="$COMMAND USER \"$POSTGRES_USER\" WITH SUPERUSER ENCRYPTED PASSWORD '$POSTGRES_PASS';" +echo "$STATEMENT" > /tmp/setup_superuser.sql +su - postgres -c "psql postgres -f /tmp/setup_superuser.sql" +rm /tmp/setup_superuser.sql role_check "$REPLICATION_USER" -su - postgres -c "psql postgres -c \"$COMMAND USER $REPLICATION_USER WITH REPLICATION ENCRYPTED PASSWORD '$REPLICATION_PASS';\"" +STATEMENT_REPLICATION="$COMMAND USER \"$REPLICATION_USER\" WITH REPLICATION ENCRYPTED PASSWORD '$REPLICATION_PASS';" +echo "$STATEMENT_REPLICATION" > /tmp/setup_replication.sql +su - postgres -c "psql postgres -f /tmp/setup_replication.sql" +rm /tmp/setup_replication.sql