0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00
postfixadmin/debian/postfixadmin.postinst

32 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

#!/bin/bash
set -e
if [ "$1" = "configure" ]; then
# configure DB stuff via dbconfig-common
dbc_generate_include=php:/etc/postfixadmin/dbconfig.inc.php
dbc_generate_include_args="-O root:www-data -m 640 -U"
. /usr/share/debconf/confmodule
. /usr/share/dbconfig-common/dpkg/postinst
dbc_go postfixadmin $@
fi
# remove legacy apache and lighthttpd configuration symlink,
# conf.d is no longer supported with Apache 2.4
if [ "$(readlink /etc/apache2/conf.d/postfixadmin)" = "../../postfixadmin/apache.conf" ]; then
rm -f /etc/apache2/conf.d/postfixadmin
fi
if [ "$(readlink /etc/lighttpd/conf-available/postfixadmin)" = "../../postfixadmin/lighttpd.conf" ]; then
rm -f /etc/lighttpd/conf-available/postfixadmin
fi
# See : https://sourceforge.net/p/postfixadmin/bugs/376/ - remove any existing templates_c files on upgrade.
if [ -d /usr/share/postfixadmin/templates_c ]; then
find /usr/share/postfixadmin/templates_c -type f -exec rm -r {} \;
fi
if [ -d /var/cache/postfixadmin/templates_c ]; then
find /var/cache/postfixadmin/templates_c -type f -exec rm -r {} \;
fi
#DEBHELPER#
exit 0