PREIN
/bin/sh
getent group opendmarc >/dev/null || groupadd -r opendmarc
getent passwd opendmarc >/dev/null || \
useradd -r -g opendmarc -G mail -d /var/run/opendmarc -s /sbin/nologin \
-c "OpenDMARC Milter" opendmarc
exit 0
PREUN
/bin/sh
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable opendmarc.service > /dev/null 2>&1 || :
/bin/systemctl stop opendmarc.service > /dev/null 2>&1 || :
fi
POSTIN
/bin/sh
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl enable opendmarc.service >/dev/null 2>&1 || :
fi
POSTUN
/bin/sh
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart opendmarc.service >/dev/null 2>&1 || :
fi