1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-07-28 10:42:06 +03:00

Minor formatting/output changes

This commit is contained in:
Tianon Gravi
2014-12-24 16:43:17 -07:00
parent ae81e91148
commit c9d9f4c1a0
14 changed files with 63 additions and 42 deletions

View File

@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then
pass="PASSWORD '$POSTGRES_PASSWORD'"
authMethod=md5
else
# The - option suppresses leading tabs but *not* spaces. :)
# The - option suppresses leading tabs but *not* spaces. :)
cat >&2 <<-'EOWARN'
****************************************************
WARNING: No password has been set for the database.
@ -33,14 +33,17 @@ if [ "$1" = 'postgres' ]; then
op='ALTER'
else
op='CREATE'
gosu postgres postgres --single -E <<-EOSQL
CREATE DATABASE "$POSTGRES_USER"
gosu postgres postgres --single -jE <<-EOSQL
CREATE DATABASE "$POSTGRES_USER" ;
EOSQL
echo
fi
gosu postgres postgres --single <<-EOSQL
$op USER "$POSTGRES_USER" WITH SUPERUSER $pass
gosu postgres postgres --single -jE <<-EOSQL
$op USER "$POSTGRES_USER" WITH SUPERUSER $pass ;
EOSQL
echo
{ echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf
if [ -d /docker-entrypoint-initdb.d ]; then