]> git.proxmox.com Git - pmg-api.git/blob - debian/postinst
bin/pmgtunnel: new service to tunnel database connections
[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 if systemctl --quiet is-active pmgdaemon.service ; then
13 deb-systemd-invoke reload-or-try-restart pmgdaemon.service
14 fi
15
16 if systemctl --quiet is-active pmgproxy.service ; then
17 deb-systemd-invoke reload-or-try-restart pmgproxy.service
18 fi
19
20 if systemctl --quiet is-active pmg-smtp-filter.service ; then
21 deb-systemd-invoke reload-or-try-restart pmg-smtp-filter.service
22 fi
23
24 if systemctl --quiet is-active pmgpolicy.service ; then
25 deb-systemd-invoke reload-or-try-restart pmgpolicy.service
26 fi
27
28 if systemctl --quiet is-active pmgtunnel.service ; then
29 deb-systemd-invoke reload-or-try-restart pmgtunnel.service
30 fi
31
32 exit 0
33 ;;
34
35 configure)
36
37 test -e /proxmox_install_mode && exit 0;
38
39 pmgconfig init
40
41 if [ -n "$2" ]; then
42 pmgconfig sync
43 else
44 if systemctl --quiet is-active pmgpolicy.service ; then
45 deb-systemd-invoke reload-or-try-restart postgres.service
46 fi
47 pmgconfig sync --restart
48 fi
49
50 pmgdb init
51 pmgdb update >/dev/null 2>&1 &
52
53 update-mime-database /usr/share/mime
54 ;;
55
56 abort-upgrade|abort-remove|abort-deconfigure)
57 ;;
58
59 *)
60 echo "postinst called with unknown argument \`$1'" >&2
61 exit 1
62 ;;
63 esac
64
65 # dh_installdeb will replace this with shell code automatically
66 # generated by other debhelper scripts.
67
68 #DEBHELPER#
69
70 exit 0