case "$1" in
+ triggered)
+
+ test -e /proxmox_install_mode && exit 0;
+
+ # Note: reload-or-try-restart fails if service is not active
+ for service in pmgdaemon pmgproxy pmg-smtp-filter pmgpolicy pmgtunnel pmgmirror; do
+ if systemctl --quiet is-active $service.service ; then
+ deb-systemd-invoke reload-or-try-restart $service.service
+ fi
+ done
+
+ exit 0
+ ;;
+
configure)
+
+ if test ! -e /proxmox_install_mode ; then
+
+ pmgconfig init
+ pmgdb init
+
+ if [ -n "$2" ]; then
+ pmgconfig sync
+ else
+ if systemctl --quiet is-active pmgpolicy.service ; then
+ deb-systemd-invoke reload-or-try-restart postgresql.service
+ fi
+ pmgconfig sync --restart
+ deb-systemd-invoke restart postfix.service
+ fi
+
+ pmgdb update >/dev/null 2>&1 &
+
+ update-mime-database /usr/share/mime
+ else
+ # rewrite banner
+ pmgbanner || true
+ fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
#DEBHELPER#
+if test ! -e /proxmox_install_mode ; then
+ for service in pmgdaemon pmgproxy; do
+ if [ -n "$2" ]; then
+ # Note: reload-or-try-restart fails if service is not active
+ if systemctl --quiet is-active $service.service ; then
+ deb-systemd-invoke reload-or-try-restart $service.service
+ fi
+ else
+ deb-systemd-invoke start $service.service
+ fi
+ done
+fi
+
exit 0