Skip to content

Commit

Permalink
make probe-readiness.sh use variables for DB_USER and DB_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
infinitewarp committed Jun 14, 2021
1 parent 702c1bb commit ce8b391
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion probe-readiness.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/bash

PGPASSWORD="$DB_PASSWORD" /usr/pgsql-13/bin/psql -h localhost -p 5432 -U postgres -c "select 1 as psql_is_ready" 2>/dev/null | grep "psql_is_ready"
# Note: host and port should remain localhost and 5432 because
# those represent the location of pgbouncer itself, not the
# remote psql server that would have $DB_HOST:$DB_PORT.

PGPASSWORD="$DB_PASSWORD" /usr/pgsql-13/bin/psql \
-h localhost -p 5432 -U "${DB_USER}" -d "${DB_NAME}" \
-c "select 1 as psql_is_ready" 2>/dev/null \
| grep "psql_is_ready"
exit $?

0 comments on commit ce8b391

Please sign in to comment.