]> git.proxmox.com Git - pmg-api.git/blame - debian/postinst
fix schema definition
[pmg-api.git] / debian / postinst
CommitLineData
0854fb22
DM
1#!/bin/sh
2
3set -e
4
5
6case "$1" in
3cf7a549
DM
7 triggered)
8
9 test -e /proxmox_install_mode && exit 0;
10
11 # Note: reload-or-try-restart fails if service is not active
b970485e
DM
12 for service in pmgdaemon pmgproxy pmg-smtp-filter pmgpolicy pmgtunnel pmgmirror; do
13 if systemctl --quiet is-active $service.service ; then
14 deb-systemd-invoke reload-or-try-restart $service.service
15 fi
16 done
07f15aa3 17
3cf7a549
DM
18 exit 0
19 ;;
20
0854fb22 21 configure)
ebe7f62b 22
7aa01a97 23 if test ! -e /proxmox_install_mode ; then
cf521b5d 24
5e374987
DM
25 pmgconfig init
26 pmgdb init
ef23c01a 27
5e374987
DM
28 if [ -n "$2" ]; then
29 pmgconfig sync
30 else
31 if systemctl --quiet is-active pmgpolicy.service ; then
b4610a89 32 deb-systemd-invoke reload-or-try-restart postgresql.service
5e374987
DM
33 fi
34 pmgconfig sync --restart
ef23c01a 35 fi
ef23c01a 36
5e374987 37 pmgdb update >/dev/null 2>&1 &
cf521b5d 38
5e374987 39 update-mime-database /usr/share/mime
07959366
DM
40 else
41 # rewrite banner
42 pmgbanner || true
5e374987 43 fi
0854fb22
DM
44 ;;
45
46 abort-upgrade|abort-remove|abort-deconfigure)
47 ;;
48
49 *)
50 echo "postinst called with unknown argument \`$1'" >&2
51 exit 1
52 ;;
53esac
54
55# dh_installdeb will replace this with shell code automatically
56# generated by other debhelper scripts.
57
58#DEBHELPER#
59
2305fb86
DM
60if test ! -e /proxmox_install_mode ; then
61 for service in pmgdaemon pmgproxy; do
62 if [ -n "$2" ]; then
63 # Note: reload-or-try-restart fails if service is not active
64 if systemctl --quiet is-active $service.service ; then
65 deb-systemd-invoke reload-or-try-restart $service.service
66 fi
67 else
68 deb-systemd-invoke start $service.service
69 fi
70 done
71fi
72
0854fb22 73exit 0