]> git.proxmox.com Git - pmg-api.git/blob - debian/postinst
postinst: call pmgdb init before config sync
[pmg-api.git] / debian / postinst
1 #!/bin/sh
2
3 set -e
4
5
6 case "$1" in
7 triggered)
8
9 test -e /proxmox_install_mode && exit 0;
10
11 # Note: reload-or-try-restart fails if service is not active
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
17
18 exit 0
19 ;;
20
21 configure)
22
23 test -e /proxmox_install_mode && exit 0;
24
25 pmgconfig init
26 pmgdb init
27
28 if [ -n "$2" ]; then
29 pmgconfig sync
30 else
31 if systemctl --quiet is-active pmgpolicy.service ; then
32 deb-systemd-invoke reload-or-try-restart postgres.service
33 fi
34 pmgconfig sync --restart
35 fi
36
37 pmgdb update >/dev/null 2>&1 &
38
39 update-mime-database /usr/share/mime
40 ;;
41
42 abort-upgrade|abort-remove|abort-deconfigure)
43 ;;
44
45 *)
46 echo "postinst called with unknown argument \`$1'" >&2
47 exit 1
48 ;;
49 esac
50
51 # dh_installdeb will replace this with shell code automatically
52 # generated by other debhelper scripts.
53
54 #DEBHELPER#
55
56 exit 0