Merge tag 'kivitendo_3.5.4-2' into b-3.5.6.1
[kivitendo-erp.git] / debian / kivitendo.postinst
diff --git a/debian/kivitendo.postinst b/debian/kivitendo.postinst
new file mode 100755 (executable)
index 0000000..37fad6b
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+
+# kivitendo postinst
+
+version="3.5.4"
+
+# check configuration file
+if [ ! -e /opt/kivitendo-erp-$version/config/kivitendo.conf ]
+then
+       echo "Type new kivitendo admin password:"
+       read a
+       sed "s/admin123/$a/" /opt/kivitendo-erp-$version/config/kivitendo.conf.default >/opt/kivitendo-erp-$version/config/kivitendo.conf
+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
+
+systemctl restart apache2
+
+# call installation check
+/opt/kivitendo-erp-$version/scripts/installation_check.pl
+