File: postfixadmin.postinst

package info (click to toggle)
postfixadmin 4.0.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,888 kB
  • sloc: php: 12,256; perl: 1,156; sh: 717; python: 142; xml: 63; sql: 3; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 1,137 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/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 $@
	touch "/etc/postfixadmin/config.local.php"
fi

# See: (deadlink) 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

# fix permissions, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856338
chown www-data /var/cache/postfixadmin/templates_c
chmod 700 /var/cache/postfixadmin/templates_c

# since 3.3.14+ds1-1, smarty has been external shared php libs.
# upgrading from bookworm to trixie breaks because the symlink is not created correctly
# Bug: #1091492 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1091492)
if [ -d /usr/share/postfixadmin/lib/smarty/libs ]; then
	rm -rf /usr/share/postfixadmin/lib/smarty/libs
fi

#DEBHELPER#

exit 0