mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
13 lines
338 B
Bash
13 lines
338 B
Bash
|
|
#!/bin/bash
|
||
|
|
set -e
|
||
|
|
set -o pipefail
|
||
|
|
|
||
|
|
PGUSER=${PGUSER:=postgres}
|
||
|
|
PGPASSWORD=${PGPASSWORD:=postgres}
|
||
|
|
chown -R postgres.postgres "$PGDATA"
|
||
|
|
pwfile=$(mktemp)
|
||
|
|
echo "$PGPASSWORD" > $pwfile
|
||
|
|
chown postgres $pwfile
|
||
|
|
su postgres -c "$PGBIN/initdb --pgdata=${PGDATA} --username=${PGUSER} --encoding=unicode --auth=trust --pwfile=$pwfile"
|
||
|
|
rm -f $pwfile
|