#!/bin/sh # 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 awk '/<.Virtual/ { print ""; \ print "#mlohn#"; \ print "# Configuration for mLohn Gui"; \ print " Alias /mlohn/gui/ \"/usr/share/php/mLohn/gui/\""; \ print " "; \ print " Options +FollowSymlinks"; \ print " RewriteEngine On"; \ print " RewriteBase /mlohn/gui/"; \ print " RewriteRule ^.*php$ mLohnGUI.php"; \ print " "; \ print " ";\ print " Options Indexes";\ print " ";\ print "#mlohn end#"; } \ {print $0;}' default >xxx mv xxx default echo "/etc/apache2/sites-available/default changed" 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