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