aboutsummaryrefslogtreecommitdiffstats
path: root/community/roundcubemail/roundcubemail.post-install
blob: 1774e77a1a689104af6aaba1ea4e23a0788c01f0 (plain)
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
33
34
35
36
37
38
39
#!/bin/sh

keyfile='/etc/roundcube/session_key'

if ! [ -e "$keyfile" ]; then
	echo '* Generating random session key' >&2

	{ head /dev/urandom | tr -dc A-Za-z0-9 | head -c 24 && echo ''; } > "$keyfile"
	chmod 440 "$keyfile"

	# This is for silly and insecure type of installation when Roundcube
	# is run under Apache with Apache's privileges instead of separate
	# user. Just for backward compatibility.
	# Ignore if group www-data does not exist.
	chgrp www-data "$keyfile" 2>/dev/null || true
fi

if [ "${0##*.}" = 'post-upgrade' ]; then
	ver_new="$1"
	ver_old="$2"

	cat >&2 <<-EOF
	*
	* Please read /usr/share/doc/roundcube/UPGRADE
	* in roundcubemail-doc package for schema or config update
	*
	EOF

	if [ "$(apk version -t "$ver_old" '1.3.6-r1')" = '<' ]; then
		cat >&2 <<-EOF
		*
		* Roundcube plugins managesieve and zipdownload has been moved into
		* subpackages. If you use them, install roundcubemail-<plugin> using apk
		* (e.g. apk add roundcubemail-zipdownload).
		*
		EOF
	fi
fi
exit 0