diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index 40eb716850..5691f092cb 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then chown -R postgres:postgres /run/postgresql # look specifically for PG_VERSION, as it is expected in the DB dir - if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then + if [ -s "$PGDATA/PG_VERSION" ]; then gosu postgres initdb sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 40eb716850..5691f092cb 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then chown -R postgres:postgres /run/postgresql # look specifically for PG_VERSION, as it is expected in the DB dir - if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then + if [ -s "$PGDATA/PG_VERSION" ]; then gosu postgres initdb sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index 40eb716850..5691f092cb 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then chown -R postgres:postgres /run/postgresql # look specifically for PG_VERSION, as it is expected in the DB dir - if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then + if [ -s "$PGDATA/PG_VERSION" ]; then gosu postgres initdb sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index 40eb716850..5691f092cb 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then chown -R postgres:postgres /run/postgresql # look specifically for PG_VERSION, as it is expected in the DB dir - if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then + if [ -s "$PGDATA/PG_VERSION" ]; then gosu postgres initdb sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index 40eb716850..5691f092cb 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then chown -R postgres:postgres /run/postgresql # look specifically for PG_VERSION, as it is expected in the DB dir - if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then + if [ -s "$PGDATA/PG_VERSION" ]; then gosu postgres initdb sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf diff --git a/9.5/docker-entrypoint.sh b/9.5/docker-entrypoint.sh index 40eb716850..5691f092cb 100755 --- a/9.5/docker-entrypoint.sh +++ b/9.5/docker-entrypoint.sh @@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then chown -R postgres:postgres /run/postgresql # look specifically for PG_VERSION, as it is expected in the DB dir - if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then + if [ -s "$PGDATA/PG_VERSION" ]; then gosu postgres initdb sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 40eb716850..5691f092cb 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then chown -R postgres:postgres /run/postgresql # look specifically for PG_VERSION, as it is expected in the DB dir - if [ -z "$(ls -A "$PGDATA"/PG_VERSION)" ]; then + if [ -s "$PGDATA/PG_VERSION" ]; then gosu postgres initdb sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf