Check that PG_VERSION is non-empty.
This commit is contained in:
parent
3231f4a4d8
commit
9c7bb73021
|
|
@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then
|
||||||
chown -R postgres:postgres /run/postgresql
|
chown -R postgres:postgres /run/postgresql
|
||||||
|
|
||||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
# 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
|
gosu postgres initdb
|
||||||
|
|
||||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then
|
||||||
chown -R postgres:postgres /run/postgresql
|
chown -R postgres:postgres /run/postgresql
|
||||||
|
|
||||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
# 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
|
gosu postgres initdb
|
||||||
|
|
||||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then
|
||||||
chown -R postgres:postgres /run/postgresql
|
chown -R postgres:postgres /run/postgresql
|
||||||
|
|
||||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
# 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
|
gosu postgres initdb
|
||||||
|
|
||||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then
|
||||||
chown -R postgres:postgres /run/postgresql
|
chown -R postgres:postgres /run/postgresql
|
||||||
|
|
||||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
# 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
|
gosu postgres initdb
|
||||||
|
|
||||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then
|
||||||
chown -R postgres:postgres /run/postgresql
|
chown -R postgres:postgres /run/postgresql
|
||||||
|
|
||||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
# 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
|
gosu postgres initdb
|
||||||
|
|
||||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then
|
||||||
chown -R postgres:postgres /run/postgresql
|
chown -R postgres:postgres /run/postgresql
|
||||||
|
|
||||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
# 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
|
gosu postgres initdb
|
||||||
|
|
||||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ if [ "$1" = 'postgres' ]; then
|
||||||
chown -R postgres:postgres /run/postgresql
|
chown -R postgres:postgres /run/postgresql
|
||||||
|
|
||||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
# 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
|
gosu postgres initdb
|
||||||
|
|
||||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue