Skip to content

Commit

Permalink
fix #463
Browse files Browse the repository at this point in the history
  • Loading branch information
spatialgeobyte committed Mar 16, 2024
1 parent 6a40293 commit 200561d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/setup-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 200561d

Please sign in to comment.