]> git.proxmox.com Git - pmg-api.git/blob - debian/postinst
do not use #DEBHELPER# macro inside comment
[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 if test -e /proxmox_install_mode ; then
24 # do nothing in test mode here, but setup services below
25 else
26
27 pmgconfig init
28 pmgdb init
29
30 if [ -n "$2" ]; then
31 pmgconfig sync
32 else
33 if systemctl --quiet is-active pmgpolicy.service ; then
34 deb-systemd-invoke reload-or-try-restart postgres.service
35 fi
36 pmgconfig sync --restart
37 fi
38
39 pmgdb update >/dev/null 2>&1 &
40
41 update-mime-database /usr/share/mime
42 fi
43 ;;
44
45 abort-upgrade|abort-remove|abort-deconfigure)
46 ;;
47
48 *)
49 echo "postinst called with unknown argument \`$1'" >&2
50 exit 1
51 ;;
52 esac
53
54 # dh_installdeb will replace this with shell code automatically
55 # generated by other debhelper scripts.
56
57 #DEBHELPER#
58
59 exit 0