Browse Source

fixed create user/db script names

tags/9.6-1.1.0
Robin Thoni 7 years ago
parent
commit
a8f7978b97

+ 2
- 6
docker-entrypoint-initdb-core.d/1.0.0_01_create_db.sh View File

6
   exit 0
6
   exit 0
7
 fi
7
 fi
8
 
8
 
9
-if [ "${POSTGRES_USER}" != 'postgres' ]
9
+if [ "${POSTGRES_DB}" != 'postgres' ]
10
 then
10
 then
11
   psql <<-EOF
11
   psql <<-EOF
12
-  CREATE USER "${POSTGRES_USER}" WITH SUPERUSER PASSWORD '${POSTGRES_PASSWORD}';
13
-EOF
14
-else
15
-  psql <<-EOF
16
-  ALTER USER "${POSTGRES_USER}" WITH SUPERUSER PASSWORD '${POSTGRES_PASSWORD}';
12
+  CREATE DATABASE "${POSTGRES_DB}";
17
 EOF
13
 EOF
18
 fi
14
 fi

+ 6
- 2
docker-entrypoint-initdb-core.d/1.0.0_02_create_user.sh View File

6
   exit 0
6
   exit 0
7
 fi
7
 fi
8
 
8
 
9
-if [ "${POSTGRES_DB}" != 'postgres' ]
9
+if [ "${POSTGRES_USER}" != 'postgres' ]
10
 then
10
 then
11
   psql <<-EOF
11
   psql <<-EOF
12
-  CREATE DATABASE "${POSTGRES_DB}";
12
+  CREATE USER "${POSTGRES_USER}" WITH SUPERUSER PASSWORD '${POSTGRES_PASSWORD}';
13
+EOF
14
+else
15
+  psql <<-EOF
16
+  ALTER USER "${POSTGRES_USER}" WITH SUPERUSER PASSWORD '${POSTGRES_PASSWORD}';
13
 EOF
17
 EOF
14
 fi
18
 fi

Loading…
Cancel
Save