#!/bin/sh set -e # mlohn postinst # check, whether mlohn user exists if ! mysql -umlohn -pmlohn mlohn -e";" then echo "Installation of mlohn user ..." echo "Password of mysql root:" read pw mysql -uroot -p$pw </dev/null then # .conf necessary for Debian 7 a2ensite mlohn.conf fi # activate rewrite engine if ! test -e /etc/apache2/mods-enabled/rewrite.load then ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled echo "rewrite engine enabled" fi # restart apache /etc/init.d/apache2 restart # create directory for Lohnabrechnungen mkdir -p /var/mlohn/print chown www-data /var/mlohn/print chgrp www-data /var/mlohn/print