Skip to content

Commit

Permalink
Fix grep error on custom pgbouncer.ini without userlist.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
vdboor committed Jan 23, 2021
1 parent decdbfd commit d33ec7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ fi

# Write the password with MD5 encryption, to avoid printing it during startup.
# Notice that `docker inspect` will show unencrypted env variables.
if [ -n "$DB_USER" -a -n "$DB_PASSWORD" ] && ! grep -q "^\"$DB_USER\"" ${PG_CONFIG_DIR}/userlist.txt; then
_AUTH_FILE="${AUTH_FILE:-$PG_CONFIG_DIR/userlist.txt}"
if [ -n "$DB_USER" -a -n "$DB_PASSWORD" -a -e "${_AUTH_FILE}" ] && ! grep -q "^\"$DB_USER\"" "${_AUTH_FILE}"; then
if [ "$AUTH_TYPE" != "plain" ]; then
pass="md5$(echo -n "$DB_PASSWORD$DB_USER" | md5sum | cut -f 1 -d ' ')"
else
Expand Down

0 comments on commit d33ec7c

Please sign in to comment.