diff options
author | Britney Fransen <brfransen@gmail.com> | 2018-09-06 16:35:27 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2018-09-06 16:35:27 (GMT) |
commit | 5669815ec3a539cf7b5ac7d8da2cbba3aeff44be (patch) | |
tree | f13051093a52f47f5954c2ee2a783bc2f0f62f96 /abs/extra/postgresql/postgresql.install | |
parent | 8d35f28049488f2585ef765bf48e7a58958fd587 (diff) | |
parent | 04697136037cb5341ee6c051f8aaa265c0400c82 (diff) | |
download | linhes_pkgbuild-5669815ec3a539cf7b5ac7d8da2cbba3aeff44be.zip linhes_pkgbuild-5669815ec3a539cf7b5ac7d8da2cbba3aeff44be.tar.gz linhes_pkgbuild-5669815ec3a539cf7b5ac7d8da2cbba3aeff44be.tar.bz2 |
Merge branch 'testing'
Diffstat (limited to 'abs/extra/postgresql/postgresql.install')
-rw-r--r-- | abs/extra/postgresql/postgresql.install | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/abs/extra/postgresql/postgresql.install b/abs/extra/postgresql/postgresql.install index c524322..0d23d47 100644 --- a/abs/extra/postgresql/postgresql.install +++ b/abs/extra/postgresql/postgresql.install @@ -2,9 +2,17 @@ post_install() { if [ ! -d '/var/lib/postgres' ]; then mkdir -p '/var/lib/postgres' fi - getent group postgres >/dev/null || groupadd -g 88 postgres - getent passwd postgres >/dev/null || useradd -c 'PostgreSQL user' -u 88 -g postgres -d '/var/lib/postgres' -s /bin/bash postgres - passwd -l postgres >/dev/null + if ! getent group postgres >/dev/null; then + groupadd -g 88 postgres + fi + if ! getent passwd postgres >/dev/null; then + useradd -c 'PostgreSQL user' -u 88 -g postgres -d '/var/lib/postgres' -s /bin/bash postgres + passwd -l postgres >/dev/null + fi + if [ ! -d '/var/lib/postgres/data' ]; then + mkdir -p '/var/lib/postgres/data' + chown postgres:postgres '/var/lib/postgres/data' + fi } post_upgrade() { @@ -15,12 +23,3 @@ post_upgrade() { chsh -s /bin/bash postgres fi } - -post_remove() { - if getent passwd postgres >/dev/null; then - userdel postgres - fi - if getent group postgres >/dev/null; then - groupdel postgres - fi -} |