6 ucf_register_templates
() {
7 for template
in /etc
/pmg
/templates
/*; do
8 [ -e "$template" ] ||
continue;
9 template_base
=$
(basename "${template}")
10 if echo "${template_base}" |
grep -q '\.ucf-'; then
13 if [ -e "/var/lib/pmg/templates/${template_base}" ]; then
14 ucf
"/var/lib/pmg/templates/${template_base}" "${template}"
15 ucfr pmg-api
"${template}"
17 echo "template '${template}' not shipped by pmg-api."
25 test -e /proxmox_install_mode
&& exit 0;
27 # Note: reload-or-try-restart fails if service is not active
28 for service
in pmgdaemon pmgproxy pmg-smtp-filter pmgpolicy pmgtunnel pmgmirror
; do
29 if systemctl
--quiet is-active
$service.service
; then
30 deb-systemd-invoke reload-or-try-restart
$service.service
>/dev
/null || true
39 if test ! -e /proxmox_install_mode
; then
44 ucf_register_templates
45 pmgconfig sync
--restart
48 if systemctl
--quiet is-active pmgpolicy.service
; then
49 deb-systemd-invoke reload-or-try-restart postgresql.service
>/dev
/null || true
51 deb-systemd-invoke restart postfix.service
>/dev
/null || true
54 pmgdb update
>/dev
/null
2>&1 &
56 update-mime-database
/usr
/share
/mime
65 ucf_register_templates
68 abort-remove|abort-deconfigure
)
72 echo "postinst called with unknown argument \`$1'" >&2
77 # dh_installdeb will replace this with shell code automatically
78 # generated by other debhelper scripts.
82 if test ! -e /proxmox_install_mode
; then
83 for service
in pmgdaemon pmgproxy
; do
85 # Note: reload-or-try-restart fails if service is not active
86 if systemctl
--quiet is-active
$service.service
; then
87 deb-systemd-invoke reload-or-try-restart
$service.service
>/dev
/null || true
90 deb-systemd-invoke start
$service.service
> /dev
/null || true