PREUN
/bin/sh
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable nginx.service > /dev/null 2>&1 || :
systemctl stop nginx.service > /dev/null 2>&1 || :
fi
POSTIN
/bin/sh
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl preset nginx.service >/dev/null 2>&1 || :
fi
if [ $1 -eq 2 ]; then
# Make sure these directories are not world readable.
chmod 700 /var/lib/nginx
chmod 700 /var/lib/nginx/tmp
chmod 700 /var/log/nginx
fi
POSTUN
/bin/sh
systemctl daemon-reload >/dev/null 2>&1 || :