X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/72abd969e20421aaa76fa6bd675c261ffcf1863c..dc2a8f704fb1cf452e11fc1c80c2f5e39ea8f30f:/debian/kivitendo.postinst diff --git a/debian/kivitendo.postinst b/debian/kivitendo.postinst index 37fad6b3a..1999d3049 100755 --- a/debian/kivitendo.postinst +++ b/debian/kivitendo.postinst @@ -3,22 +3,38 @@ set -e # kivitendo postinst -version="3.5.4" - # check configuration file -if [ ! -e /opt/kivitendo-erp-$version/config/kivitendo.conf ] +if [ ! -e /opt/kivitendo-erp/config/kivitendo.conf ] then - echo "Type new kivitendo admin password:" + echo "Type new kivitendo admin and DB password:" read a - sed "s/admin123/$a/" /opt/kivitendo-erp-$version/config/kivitendo.conf.default >/opt/kivitendo-erp-$version/config/kivitendo.conf + sed "s/admin123/$a/" /opt/kivitendo-erp/config/kivitendo.conf.default >/opt/kivitendo-erp/config/kivitendo.conf +fi + +# test DB login +if ! echo "\q" | psql kivitendo_auth kivitendo +then + # create kivitendo user + su postgres -c "createuser -dPs kivitendo" +fi +if ! grep kivitendo /etc/postgresql/*/main/pg_hba.conf >/dev/null +then + echo "local all kivitendo md5" >> /etc/postgresql/*/main/pg_hba.conf + systemctl reload postgresql fi # allow write access to some directories -chown www-data /opt/kivitendo-erp-$version/users /opt/kivitendo-erp-$version/templates -chgrp www-data /opt/kivitendo-erp-$version/users /opt/kivitendo-erp-$version/templates +chown www-data /opt/kivitendo-erp/users /opt/kivitendo-erp/templates +chgrp www-data /opt/kivitendo-erp/users /opt/kivitendo-erp/templates systemctl restart apache2 # call installation check -/opt/kivitendo-erp-$version/scripts/installation_check.pl +/opt/kivitendo-erp/scripts/installation_check.pl + +if [ ! -d /opt/kivitendo-erp/webdav ] +then + mkdir /opt/kivitendo-erp/webdav + chown www-data:www-data /opt/kivitendo-erp/webdav +fi