X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/dc2a8f704fb1cf452e11fc1c80c2f5e39ea8f30f..75279078c6935bb53fc72d66239081912f56719c:/debian/kivitendo.postinst 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