#!/bin/sh # postinst script for collection4 # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package . /usr/share/debconf/confmodule configure_apache2() { a2reload="false" if [ -d /etc/apache2/conf.d/ ]; then if [ ! -e /etc/apache2/conf.d/collection4.conf ]; then ln -s /etc/collection4/apache.conf /etc/apache2/conf.d/collection4.conf a2reload="true" fi fi if [ -d /etc/apache2/mods-enabled ]; then if [ ! -e /etc/apache2/mods-enabled/fcgid.load -a \ -e /etc/apache2/mods-available/fcgid.load ]; then a2enmod fcgid a2reload="true" else if [ ! -e /etc/apache2/mods-enabled/fastcgi.load -a \ -e /etc/apache2/mods-available/fastcgi.load ]; then a2enmod fastcgi a2reload="true" fi; fi fi if [ "$a2reload" = "true" ]; then invoke-rc.d apache2 reload fi } case "$1" in configure) db_get collection4/httpd http_servers=`echo $RET | sed -e 's/,/ /g'` for httpd in $http_servers; do case "$httpd" in apache2) configure_apache2 ;; # WISHLIST: configure other web servers as well *) echo "Don't know how to configure web server $httpd" >&2 ;; esac done ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0