From 75279078c6935bb53fc72d66239081912f56719c Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Mon, 18 Jan 2021 20:08:49 +0100 Subject: [PATCH] epic-ts --- debian/kivitendo.postinst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/kivitendo.postinst b/debian/kivitendo.postinst index 1999d3049..4f9364a42 100755 --- a/debian/kivitendo.postinst +++ b/debian/kivitendo.postinst @@ -12,14 +12,15 @@ then fi # test DB login -if ! echo "\q" | psql kivitendo_auth kivitendo +if ! su postgres -c "psql -c '\du'" | grep kivitendo >/dev/null then - # create kivitendo user + echo "No user named 'kivitendo' found. It is now created. Use the same password!" su postgres -c "createuser -dPs kivitendo" fi -if ! grep kivitendo /etc/postgresql/*/main/pg_hba.conf >/dev/null +main=$(ls -d /etc/postgresql/*/main/) +if ! grep kivitendo $main/pg_hba.conf >/dev/null then - echo "local all kivitendo md5" >> /etc/postgresql/*/main/pg_hba.conf + echo "local all kivitendo md5" >> $main/pg_hba.conf systemctl reload postgresql fi -- 2.20.1