6 ucf_register_templates
() {
7 for template
in /etc
/pmg
/templates
/*; do
8 template_base
=$
(basename "${template}")
9 if echo "${template_base}" |
grep -q '\.ucf-'; then
12 if [ -e "/var/lib/pmg/templates/${template_base}" ]; then
13 ucf
"/var/lib/pmg/templates/${template_base}" "${template}"
14 ucfr pmg-api
"${template}"
16 echo "template '${template}' not shipped by pmg-api."
24 test -e /proxmox_install_mode
&& exit 0;
26 # Note: reload-or-try-restart fails if service is not active
27 for service
in pmgdaemon pmgproxy pmg-smtp-filter pmgpolicy pmgtunnel pmgmirror
; do
28 if systemctl
--quiet is-active
$service.service
; then
29 deb-systemd-invoke reload-or-try-restart
$service.service
>/dev
/null || true
38 if test ! -e /proxmox_install_mode
; then
43 ucf_register_templates
44 pmgconfig sync
--restart
47 if systemctl
--quiet is-active pmgpolicy.service
; then
48 deb-systemd-invoke reload-or-try-restart postgresql.service
>/dev
/null || true
50 deb-systemd-invoke restart postfix.service
>/dev
/null || true
53 pmgdb update
>/dev
/null
2>&1 &
55 update-mime-database
/usr
/share
/mime
64 ucf_register_templates
67 abort-remove|abort-deconfigure
)
71 echo "postinst called with unknown argument \`$1'" >&2
76 # dh_installdeb will replace this with shell code automatically
77 # generated by other debhelper scripts.
81 if test ! -e /proxmox_install_mode
; then
82 for service
in pmgdaemon pmgproxy
; do
84 # Note: reload-or-try-restart fails if service is not active
85 if systemctl
--quiet is-active
$service.service
; then
86 deb-systemd-invoke reload-or-try-restart
$service.service
>/dev
/null || true
89 deb-systemd-invoke start
$service.service
> /dev
/null || true