2022-03-08 19:42:28 +01:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2022-07-18 17:06:12 +02:00
|
|
|
if [ ! -d "/srv/postgresql" ]; then
|
|
|
|
/bin/mkdir -p /srv/postgresql/postgresql
|
|
|
|
/bin/chown -R postgres: /srv/postgresql
|
|
|
|
/usr/bin/postgresql-setup --initdb
|
|
|
|
#/bin/rm /srv/postgresql/postgresql.conf
|
|
|
|
#/bin/rm /srv/postgresql/pg_hba.conf
|
|
|
|
#/bin/rm /srv/postgresql/pg_ident.conf
|
|
|
|
elif [ ! -d "/srv/postgresql/postgresql" ]; then
|
|
|
|
# migrate /srv/postgresql to /srv/postgresql/postgresql
|
|
|
|
# needed for upgrade...
|
|
|
|
mkdir /srv/postgresql/postgresql
|
|
|
|
mv /srv/postgresql/* /srv/postgresql/postgresql || true
|
|
|
|
chown postgres: /srv/postgresql/postgresql
|
|
|
|
chmod 700 /srv/postgresql/postgresql
|
|
|
|
fi
|
|
|
|
# for postgresql-setup...
|
|
|
|
/bin/ln -sf /etc/postgresql/postgresql.conf /srv/postgresql/postgresql/postgresql.conf
|
|
|
|
/bin/ln -sf /etc/postgresql/pg_hba.conf /srv/postgresql/postgresql/pg_hba.conf
|
|
|
|
/bin/ln -sf /etc/postgresql/pg_ident.conf /srv/postgresql/postgresql/pg_ident.conf
|
2022-03-08 19:42:28 +01:00
|
|
|
exit 0
|