2021-10-08 21:37:53 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-01-12 12:54:01 +01:00
|
|
|
set -e
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
|
|
|
|
set_perms()
|
|
|
|
{
|
|
|
|
USER="$1"
|
|
|
|
GROUP="$2"
|
|
|
|
MODE="$3"
|
|
|
|
FILE="$4"
|
|
|
|
if ! dpkg-statoverride --list "$FILE" >/dev/null 2>&1; then
|
2023-03-10 01:16:45 +01:00
|
|
|
chown -h "$USER:$GROUP" "$FILE"
|
|
|
|
chmod $MODE "$FILE"
|
2023-01-12 12:54:01 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
xpostinst()
|
|
|
|
{
|
2023-03-13 13:39:13 +01:00
|
|
|
set_perms grommunio gromox 0755 /etc/gromox || :
|
2023-01-12 12:54:01 +01:00
|
|
|
for i in /var/lib/gromox \
|
2023-03-13 13:39:13 +01:00
|
|
|
/var/lib/gromox/domain \
|
|
|
|
/var/lib/gromox/user \
|
2022-04-06 18:05:20 +02:00
|
|
|
/var/lib/gromox/queue \
|
|
|
|
/var/lib/gromox/queue/cache \
|
|
|
|
/var/lib/gromox/queue/clone \
|
|
|
|
/var/lib/gromox/queue/insulation \
|
|
|
|
/var/lib/gromox/queue/mess \
|
|
|
|
/var/lib/gromox/queue/save \
|
2023-03-13 13:39:13 +01:00
|
|
|
/var/lib/gromox/queue/timer; do
|
2023-01-12 12:54:01 +01:00
|
|
|
set_perms gromox gromox 0770 "$i" || :
|
|
|
|
done
|
2023-03-13 13:39:13 +01:00
|
|
|
set_perms gromox gromox 0750 /var/log/gromox || :
|
2021-10-08 21:37:53 +02:00
|
|
|
|
|
|
|
# %post
|
2022-04-30 14:31:58 +02:00
|
|
|
if test -x /usr/bin/systemd-tmpfiles; then
|
2021-10-08 21:37:53 +02:00
|
|
|
systemd-tmpfiles --create tmpfiles-gromox.conf || :
|
2022-04-30 14:31:58 +02:00
|
|
|
else
|
|
|
|
echo "There is no systemd-tmpfiles present in the system. /run/gromox may not have been created."
|
|
|
|
fi
|
|
|
|
if test -x /usr/bin/systemctl; then
|
2021-10-08 21:37:53 +02:00
|
|
|
systemctl daemon-reload || :
|
2023-03-06 01:18:10 +01:00
|
|
|
systemctl try-restart gromox-delivery.service \
|
2022-08-30 14:14:09 +02:00
|
|
|
gromox-delivery-queue.service gromox-event.service \
|
|
|
|
gromox-http.service gromox-imap.service gromox-midb.service \
|
|
|
|
gromox-pop3.service gromox-timer.service gromox-zcore.service \
|
|
|
|
grommunio-chat.service \
|
|
|
|
php7.4-fpm.service php8.0-fpm.service php8.1-fpm.service \
|
2023-01-12 12:54:01 +01:00
|
|
|
php8.2-fpm.service \
|
2022-08-30 14:14:09 +02:00
|
|
|
saslauthd.service 2>/dev/null || :
|
2021-10-08 21:37:53 +02:00
|
|
|
fi
|
2023-01-12 12:54:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
configure|reconfigure)
|
|
|
|
xpostinst
|
|
|
|
;;
|
|
|
|
abort-upgrade|abort-remove|abort-deconfigure)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "postinst called with unknown argument \"$1\"" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|