File tree 13 files changed +78
-91
lines changed
13 files changed +78
-91
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ _is_sourced() {
34
34
35
35
# used to create initial posgres directories and if run as root, ensure ownership to the "postgres" user
36
36
docker_create_db_directories () {
37
- local user=" $( id -u) "
37
+ local user; user =" $( id -u) "
38
38
39
39
mkdir -p " $PGDATA "
40
40
chmod 700 " $PGDATA "
@@ -46,7 +46,9 @@ docker_create_db_directories() {
46
46
# Create the transaction log directory before initdb is run so the directory is owned by the correct user
47
47
if [ " $POSTGRES_INITDB_WALDIR " ]; then
48
48
mkdir -p " $POSTGRES_INITDB_WALDIR "
49
- [ " $user " = ' 0' ] && find " $POSTGRES_INITDB_WALDIR " \! -user postgres - exec chown postgres ' {}' +
49
+ if [ " $user " = ' 0' ]; then
50
+ find " $POSTGRES_INITDB_WALDIR " \! -user postgres -exec chown postgres ' {}' +
51
+ fi
50
52
chmod 700 " $POSTGRES_INITDB_WALDIR "
51
53
fi
52
54
@@ -193,10 +195,8 @@ docker_setup_env() {
193
195
194
196
# append md5 or trust auth to pg_hba.conf based on existence of POSTGRES_PASSWORD
195
197
pg_setup_hba_conf () {
196
- local authMethod
197
- if [ " $POSTGRES_PASSWORD " ]; then
198
- authMethod=' md5'
199
- else
198
+ local authMethod=' md5'
199
+ if [ -z " $POSTGRES_PASSWORD " ]; then
200
200
authMethod=' trust'
201
201
fi
202
202
@@ -232,7 +232,6 @@ _main() {
232
232
set -- postgres " $@ "
233
233
fi
234
234
235
-
236
235
if [ " $1 " = ' postgres' ]; then
237
236
docker_setup_env
238
237
# setup data directories and permissions (when run as root)
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ _is_sourced() {
34
34
35
35
# used to create initial posgres directories and if run as root, ensure ownership to the "postgres" user
36
36
docker_create_db_directories () {
37
- local user=" $( id -u) "
37
+ local user; user =" $( id -u) "
38
38
39
39
mkdir -p " $PGDATA "
40
40
chmod 700 " $PGDATA "
@@ -46,7 +46,9 @@ docker_create_db_directories() {
46
46
# Create the transaction log directory before initdb is run so the directory is owned by the correct user
47
47
if [ " $POSTGRES_INITDB_WALDIR " ]; then
48
48
mkdir -p " $POSTGRES_INITDB_WALDIR "
49
- [ " $user " = ' 0' ] && find " $POSTGRES_INITDB_WALDIR " \! -user postgres - exec chown postgres ' {}' +
49
+ if [ " $user " = ' 0' ]; then
50
+ find " $POSTGRES_INITDB_WALDIR " \! -user postgres -exec chown postgres ' {}' +
51
+ fi
50
52
chmod 700 " $POSTGRES_INITDB_WALDIR "
51
53
fi
52
54
@@ -193,10 +195,8 @@ docker_setup_env() {
193
195
194
196
# append md5 or trust auth to pg_hba.conf based on existence of POSTGRES_PASSWORD
195
197
pg_setup_hba_conf () {
196
- local authMethod
197
- if [ " $POSTGRES_PASSWORD " ]; then
198
- authMethod=' md5'
199
- else
198
+ local authMethod=' md5'
199
+ if [ -z " $POSTGRES_PASSWORD " ]; then
200
200
authMethod=' trust'
201
201
fi
202
202
@@ -232,7 +232,6 @@ _main() {
232
232
set -- postgres " $@ "
233
233
fi
234
234
235
-
236
235
if [ " $1 " = ' postgres' ]; then
237
236
docker_setup_env
238
237
# setup data directories and permissions (when run as root)
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ _is_sourced() {
34
34
35
35
# used to create initial posgres directories and if run as root, ensure ownership to the "postgres" user
36
36
docker_create_db_directories () {
37
- local user=" $( id -u) "
37
+ local user; user =" $( id -u) "
38
38
39
39
mkdir -p " $PGDATA "
40
40
chmod 700 " $PGDATA "
@@ -46,7 +46,9 @@ docker_create_db_directories() {
46
46
# Create the transaction log directory before initdb is run so the directory is owned by the correct user
47
47
if [ " $POSTGRES_INITDB_WALDIR " ]; then
48
48
mkdir -p " $POSTGRES_INITDB_WALDIR "
49
- [ " $user " = ' 0' ] && find " $POSTGRES_INITDB_WALDIR " \! -user postgres - exec chown postgres ' {}' +
49
+ if [ " $user " = ' 0' ]; then
50
+ find " $POSTGRES_INITDB_WALDIR " \! -user postgres -exec chown postgres ' {}' +
51
+ fi
50
52
chmod 700 " $POSTGRES_INITDB_WALDIR "
51
53
fi
52
54
@@ -193,10 +195,8 @@ docker_setup_env() {
193
195
194
196
# append md5 or trust auth to pg_hba.conf based on existence of POSTGRES_PASSWORD
195
197
pg_setup_hba_conf () {
196
- local authMethod
197
- if [ " $POSTGRES_PASSWORD " ]; then
198
- authMethod=' md5'
199
- else
198
+ local authMethod=' md5'
199
+ if [ -z " $POSTGRES_PASSWORD " ]; then
200
200
authMethod=' trust'
201
201
fi
202
202
@@ -232,7 +232,6 @@ _main() {
232
232
set -- postgres " $@ "
233
233
fi
234
234
235
-
236
235
if [ " $1 " = ' postgres' ]; then
237
236
docker_setup_env
238
237
# setup data directories and permissions (when run as root)
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ _is_sourced() {
34
34
35
35
# used to create initial posgres directories and if run as root, ensure ownership to the "postgres" user
36
36
docker_create_db_directories () {
37
- local user=" $( id -u) "
37
+ local user; user =" $( id -u) "
38
38
39
39
mkdir -p " $PGDATA "
40
40
chmod 700 " $PGDATA "
@@ -46,7 +46,9 @@ docker_create_db_directories() {
46
46
# Create the transaction log directory before initdb is run so the directory is owned by the correct user
47
47
if [ " $POSTGRES_INITDB_WALDIR " ]; then
48
48
mkdir -p " $POSTGRES_INITDB_WALDIR "
49
- [ " $user " = ' 0' ] && find " $POSTGRES_INITDB_WALDIR " \! -user postgres - exec chown postgres ' {}' +
49
+ if [ " $user " = ' 0' ]; then
50
+ find " $POSTGRES_INITDB_WALDIR " \! -user postgres -exec chown postgres ' {}' +
51
+ fi
50
52
chmod 700 " $POSTGRES_INITDB_WALDIR "
51
53
fi
52
54
@@ -193,10 +195,8 @@ docker_setup_env() {
193
195
194
196
# append md5 or trust auth to pg_hba.conf based on existence of POSTGRES_PASSWORD
195
197
pg_setup_hba_conf () {
196
- local authMethod
197
- if [ " $POSTGRES_PASSWORD " ]; then
198
- authMethod=' md5'
199
- else
198
+ local authMethod=' md5'
199
+ if [ -z " $POSTGRES_PASSWORD " ]; then
200
200
authMethod=' trust'
201
201
fi
202
202
@@ -232,7 +232,6 @@ _main() {
232
232
set -- postgres " $@ "
233
233
fi
234
234
235
-
236
235
if [ " $1 " = ' postgres' ]; then
237
236
docker_setup_env
238
237
# setup data directories and permissions (when run as root)
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ _is_sourced() {
34
34
35
35
# used to create initial posgres directories and if run as root, ensure ownership to the "postgres" user
36
36
docker_create_db_directories () {
37
- local user=" $( id -u) "
37
+ local user; user =" $( id -u) "
38
38
39
39
mkdir -p " $PGDATA "
40
40
chmod 700 " $PGDATA "
@@ -46,7 +46,9 @@ docker_create_db_directories() {
46
46
# Create the transaction log directory before initdb is run so the directory is owned by the correct user
47
47
if [ " $POSTGRES_INITDB_WALDIR " ]; then
48
48
mkdir -p " $POSTGRES_INITDB_WALDIR "
49
- [ " $user " = ' 0' ] && find " $POSTGRES_INITDB_WALDIR " \! -user postgres - exec chown postgres ' {}' +
49
+ if [ " $user " = ' 0' ]; then
50
+ find " $POSTGRES_INITDB_WALDIR " \! -user postgres -exec chown postgres ' {}' +
51
+ fi
50
52
chmod 700 " $POSTGRES_INITDB_WALDIR "
51
53
fi
52
54
@@ -193,10 +195,8 @@ docker_setup_env() {
193
195
194
196
# append md5 or trust auth to pg_hba.conf based on existence of POSTGRES_PASSWORD
195
197
pg_setup_hba_conf () {
196
- local authMethod
197
- if [ " $POSTGRES_PASSWORD " ]; then
198
- authMethod=' md5'
199
- else
198
+ local authMethod=' md5'
199
+ if [ -z " $POSTGRES_PASSWORD " ]; then
200
200
authMethod=' trust'
201
201
fi
202
202
@@ -232,7 +232,6 @@ _main() {
232
232
set -- postgres " $@ "
233
233
fi
234
234
235
-
236
235
if [ " $1 " = ' postgres' ]; then
237
236
docker_setup_env
238
237
# setup data directories and permissions (when run as root)
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ _is_sourced() {
34
34
35
35
# used to create initial posgres directories and if run as root, ensure ownership to the "postgres" user
36
36
docker_create_db_directories () {
37
- local user=" $( id -u) "
37
+ local user; user =" $( id -u) "
38
38
39
39
mkdir -p " $PGDATA "
40
40
chmod 700 " $PGDATA "
@@ -46,7 +46,9 @@ docker_create_db_directories() {
46
46
# Create the transaction log directory before initdb is run so the directory is owned by the correct user
47
47
if [ " $POSTGRES_INITDB_WALDIR " ]; then
48
48
mkdir -p " $POSTGRES_INITDB_WALDIR "
49
- [ " $user " = ' 0' ] && find " $POSTGRES_INITDB_WALDIR " \! -user postgres - exec chown postgres ' {}' +
49
+ if [ " $user " = ' 0' ]; then
50
+ find " $POSTGRES_INITDB_WALDIR " \! -user postgres -exec chown postgres ' {}' +
51
+ fi
50
52
chmod 700 " $POSTGRES_INITDB_WALDIR "
51
53
fi
52
54
@@ -193,10 +195,8 @@ docker_setup_env() {
193
195
194
196
# append md5 or trust auth to pg_hba.conf based on existence of POSTGRES_PASSWORD
195
197
pg_setup_hba_conf () {
196
- local authMethod
197
- if [ " $POSTGRES_PASSWORD " ]; then
198
- authMethod=' md5'
199
- else
198
+ local authMethod=' md5'
199
+ if [ -z " $POSTGRES_PASSWORD " ]; then
200
200
authMethod=' trust'
201
201
fi
202
202
@@ -232,7 +232,6 @@ _main() {
232
232
set -- postgres " $@ "
233
233
fi
234
234
235
-
236
235
if [ " $1 " = ' postgres' ]; then
237
236
docker_setup_env
238
237
# setup data directories and permissions (when run as root)
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ _is_sourced() {
34
34
35
35
# used to create initial posgres directories and if run as root, ensure ownership to the "postgres" user
36
36
docker_create_db_directories () {
37
- local user=" $( id -u) "
37
+ local user; user =" $( id -u) "
38
38
39
39
mkdir -p " $PGDATA "
40
40
chmod 700 " $PGDATA "
@@ -46,7 +46,9 @@ docker_create_db_directories() {
46
46
# Create the transaction log directory before initdb is run so the directory is owned by the correct user
47
47
if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
48
48
mkdir -p " $POSTGRES_INITDB_XLOGDIR "
49
- [ " $user " = ' 0' ] && find " $POSTGRES_INITDB_XLOGDIR " \! -user postgres - exec chown postgres ' {}' +
49
+ if [ " $user " = ' 0' ]; then
50
+ find " $POSTGRES_INITDB_XLOGDIR " \! -user postgres -exec chown postgres ' {}' +
51
+ fi
50
52
chmod 700 " $POSTGRES_INITDB_XLOGDIR "
51
53
fi
52
54
@@ -193,10 +195,8 @@ docker_setup_env() {
193
195
194
196
# append md5 or trust auth to pg_hba.conf based on existence of POSTGRES_PASSWORD
195
197
pg_setup_hba_conf () {
196
- local authMethod
197
- if [ " $POSTGRES_PASSWORD " ]; then
198
- authMethod=' md5'
199
- else
198
+ local authMethod=' md5'
199
+ if [ -z " $POSTGRES_PASSWORD " ]; then
200
200
authMethod=' trust'
201
201
fi
202
202
@@ -232,7 +232,6 @@ _main() {
232
232
set -- postgres " $@ "
233
233
fi
234
234
235
-
236
235
if [ " $1 " = ' postgres' ]; then
237
236
docker_setup_env
238
237
# setup data directories and permissions (when run as root)
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ _is_sourced() {
34
34
35
35
# used to create initial posgres directories and if run as root, ensure ownership to the "postgres" user
36
36
docker_create_db_directories () {
37
- local user=" $( id -u) "
37
+ local user; user =" $( id -u) "
38
38
39
39
mkdir -p " $PGDATA "
40
40
chmod 700 " $PGDATA "
@@ -46,7 +46,9 @@ docker_create_db_directories() {
46
46
# Create the transaction log directory before initdb is run so the directory is owned by the correct user
47
47
if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
48
48
mkdir -p " $POSTGRES_INITDB_XLOGDIR "
49
- [ " $user " = ' 0' ] && find " $POSTGRES_INITDB_XLOGDIR " \! -user postgres - exec chown postgres ' {}' +
49
+ if [ " $user " = ' 0' ]; then
50
+ find " $POSTGRES_INITDB_XLOGDIR " \! -user postgres -exec chown postgres ' {}' +
51
+ fi
50
52
chmod 700 " $POSTGRES_INITDB_XLOGDIR "
51
53
fi
52
54
@@ -193,10 +195,8 @@ docker_setup_env() {
193
195
194
196
# append md5 or trust auth to pg_hba.conf based on existence of POSTGRES_PASSWORD
195
197
pg_setup_hba_conf () {
196
- local authMethod
197
- if [ " $POSTGRES_PASSWORD " ]; then
198
- authMethod=' md5'
199
- else
198
+ local authMethod=' md5'
199
+ if [ -z " $POSTGRES_PASSWORD " ]; then
200
200
authMethod=' trust'
201
201
fi
202
202
@@ -232,7 +232,6 @@ _main() {
232
232
set -- postgres " $@ "
233
233
fi
234
234
235
-
236
235
if [ " $1 " = ' postgres' ]; then
237
236
docker_setup_env
238
237
# setup data directories and permissions (when run as root)
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ _is_sourced() {
34
34
35
35
# used to create initial posgres directories and if run as root, ensure ownership to the "postgres" user
36
36
docker_create_db_directories () {
37
- local user=" $( id -u) "
37
+ local user; user =" $( id -u) "
38
38
39
39
mkdir -p " $PGDATA "
40
40
chmod 700 " $PGDATA "
@@ -46,7 +46,9 @@ docker_create_db_directories() {
46
46
# Create the transaction log directory before initdb is run so the directory is owned by the correct user
47
47
if [ " $POSTGRES_INITDB_XLOGDIR " ]; then
48
48
mkdir -p " $POSTGRES_INITDB_XLOGDIR "
49
- [ " $user " = ' 0' ] && find " $POSTGRES_INITDB_XLOGDIR " \! -user postgres - exec chown postgres ' {}' +
49
+ if [ " $user " = ' 0' ]; then
50
+ find " $POSTGRES_INITDB_XLOGDIR " \! -user postgres -exec chown postgres ' {}' +
51
+ fi
50
52
chmod 700 " $POSTGRES_INITDB_XLOGDIR "
51
53
fi
52
54
@@ -193,10 +195,8 @@ docker_setup_env() {
193
195
194
196
# append md5 or trust auth to pg_hba.conf based on existence of POSTGRES_PASSWORD
195
197
pg_setup_hba_conf () {
196
- local authMethod
197
- if [ " $POSTGRES_PASSWORD " ]; then
198
- authMethod=' md5'
199
- else
198
+ local authMethod=' md5'
199
+ if [ -z " $POSTGRES_PASSWORD " ]; then
200
200
authMethod=' trust'
201
201
fi
202
202
@@ -232,7 +232,6 @@ _main() {
232
232
set -- postgres " $@ "
233
233
fi
234
234
235
-
236
235
if [ " $1 " = ' postgres' ]; then
237
236
docker_setup_env
238
237
# setup data directories and permissions (when run as root)
You can’t perform that action at this time.
0 commit comments