]> git.proxmox.com Git - pmg-api.git/blob - debian/postinst
debian/postinst - rewrite banner
[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
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 postgresql.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 else
41 # rewrite banner
42 pmgbanner || true
43 fi
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 ;;
53 esac
54
55 # dh_installdeb will replace this with shell code automatically
56 # generated by other debhelper scripts.
57
58 #DEBHELPER#
59
60 exit 0