#!/bin/sh set -e # Source debconf library. . /usr/share/debconf/confmodule CONFIGFILE="/etc/alternc/local.sh" update_var() { local question local var question="$1" var="$2" db_get "$question" if [ ! -z "$RET" ]; then grep -Eq "^ *$var=" $CONFIGFILE || echo "$var=" >> $CONFIGFILE SED_SCRIPT="$SED_SCRIPT;s\\^ *$var=.*\\$var=\"$RET\"\\" fi } # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. case "$1" in configure) # ajoute l'user postfix au groupe sasl adduser --quiet postfix sasl # corriger les permissions du chroot mkdir -p /var/spool/postfix/var/run/saslauthd || true dpkg-statoverride --quiet --update --add root sasl 710 /var/spool/postfix/var/run/saslauthd || true # build local.sh if it does not exist if [ ! -f $CONFIGFILE ]; then cat > $CONFIGFILE < $CONFIGFILE.tmp mv -f $CONFIGFILE.tmp $CONFIGFILE # Setup grants db_get "alternc/mysql/host" MYSQL_HOST="$RET" if [ "$MYSQL_HOST" != "localhost" -o -e /usr/sbin/mysqld ]; then # compatibility shims with my.cnf host="$RET" db_get "alternc/mysql/db" database="$RET" db_get "alternc/mysql/user" user="$RET" db_get "alternc/mysql/password" password="$RET" # we source (instead of forking) mysql.sh so that it gets the local environment above . /usr/share/alternc/install/mysql.sh fi # forget the password db_reset alternc/mysql/password || true db_fset alternc/mysql/password "seen" "false" || true if [ -e $CONFIGFILE ]; then # source local.sh variables . $CONFIGFILE fi # /var/alternc/dns/d/www.example.com FQDN_LETTER="`echo $FQDN | sed -e 's/.*\.\([^\.]\)[^\.]*\.[^\.]*$/\1/'`" if [ "$FQDN_LETTER" = "$FQDN" ] then FQDN_LETTER="_" fi # Erase all apacheconf file # They will be regenerated without the bug by upgrade_check.sh below. if dpkg --compare-versions "$2" le "0.9.3.9-globenet14"; then rm -f /var/alternc/apacheconf/*/* rm -f /var/alternc/apacheconf/override_php.conf fi echo "checking for upgrades" /usr/share/alternc/install/upgrade_check.sh $2 echo "config phpmyadmin" include_str='include("/etc/alternc/phpmyadmin.inc.php")' pma_config=/etc/phpmyadmin/config.inc.php if ! grep -e "$include_str" $pma_config > /dev/null 2>&1; then echo "" >> $pma_config fi # Add access to the management panel ln -nsf /var/alternc/bureau /var/alternc/dns/$FQDN_LETTER/$FQDN # Bind stuff touch /var/alternc/bind/automatic.conf /var/alternc/bind/slaveip.conf chown root:bind /var/alternc/bind/automatic.conf /var/alternc/bind/slaveip.conf chmod 640 /var/alternc/bind/automatic.conf /var/alternc/bind/slaveip.conf touch /var/run/alternc/refresh_slave /usr/lib/alternc/slave_dns # Apache will not start without this file touch /var/alternc/apacheconf/override_php.conf # Update l18n files /usr/share/alternc/install/dopo.sh # important: postinst gele sans ca db_stop echo "running alternc.install" alternc.install # Add basedir protection /usr/lib/alternc/basedir_prot.sh if [ -x /usr/sbin/apache ]; then if [ ! -h /etc/apache-ssl/conf.d/alternc.conf ]; then ln -sf /etc/alternc/apache-ssl.conf \ /etc/apache-ssl/conf.d/alternc.conf fi if [ ! -h /etc/apache/conf.d/alternc.conf ]; then ln -sf /etc/alternc/apache.conf \ /etc/apache/conf.d/alternc.conf fi if [ ! -h /etc/apache/conf.d/override_php.conf ]; then ln -sf /var/alternc/apacheconf/override_php.conf \ /etc/apache/conf.d/override_php.conf fi fi if [ -x /usr/sbin/apache2 ]; then if [ ! -h /etc/apache2/conf.d/alternc.conf ]; then ln -sf /etc/alternc/apache.conf \ /etc/apache/conf.d/alternc.conf fi if [ ! -h /etc/apache2/conf.d/override_php.conf ]; then ln -sf /var/alternc/apacheconf/override_php.conf \ /etc/apache/conf.d/override_php.conf fi fi ;; 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 # vim: et sw=4