#! /bin/sh # Abort if any command returns an error value set -e . /usr/share/debconf/confmodule db_version 2.0 case "$1" in configure) if test ! -d /var/lib/citadel/keys; then mkdir -p /var/lib/citadel/keys fi if test ! -d /var/run/citadel/keys; then mkdir -p /var/run/citadel/keys fi if test -e /etc/default/webcit; then . /etc/default/webcit else WEBCIT_CITADEL_IP=127.0.0.1 WEBCIT_CITADEL_PORT=504 fi db_get citadel/WebcitApacheIntegration && WWWTYPE="$RET" if test "$WWWTYPE" = "Internal"; then echo 'export WEBCIT_APACHEFLAG=" "' > /etc/default/webcit echo "export WEBCIT_LISTEN_IP=${WEBCIT_LISTEN_IP:-0.0.0.0}" >> /etc/default/webcit else echo 'export WEBCIT_APACHEFLAG="-f"' > /etc/default/webcit echo "export WEBCIT_LISTEN_IP=${WEBCIT_LISTEN_IP:-127.0.0.1}" >> /etc/default/webcit fi db_get citadel/WebcitHttpPort && echo "export WEBCIT_HTTP_PORT=$RET" >> /etc/default/webcit db_get citadel/WebcitHttpsPort && echo "export WEBCIT_HTTPS_PORT=$RET" >> /etc/default/webcit db_get citadel/WebcitOfferLang && echo "export WEBCIT_LANG=$RET" >> /etc/default/webcit echo "export WEBCIT_CITADEL_PORT=$WEBCIT_CITADEL_PORT" >> /etc/default/webcit echo "export WEBCIT_CITADEL_IP=$WEBCIT_CITADEL_IP" >> /etc/default/webcit db_stop #DEBHELPER# # update the webserver, if needed case "$WWWTYPE" in "Apache") webservers="apache" aenmod proxy||true ;; "Apache-SSL") webservers="apache-ssl" ;; "Apache2") webservers="apache2" a2enmod proxy||true a2enmod proxy_http||true ;; "All") webservers="apache apache-ssl apache2" ;; *) webservers="" ;; esac for server in $webservers; do if [ -d "/etc/${server}/conf.d" ]; then if [ ! -e "/etc/${server}/conf.d/webcit.conf" ] ; then ln -sf /etc/citadel/webcit.conf "/etc/${server}/conf.d/webcit.conf" fi invoke-rc.d $server reload || true fi done ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "$0: didn't understand being called with '$1'" 1>&2 exit 1;; esac exit 0