Properly handle systemd start/stop during Debian package install, closes #30

This commit is contained in:
Philipp Heckel 2021-12-04 15:32:21 -05:00
parent 07a1fe3acb
commit 6fbbb0c7b5
4 changed files with 38 additions and 3 deletions

12
scripts/prerm.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
set -e
# Stop systemd service
if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
echo "Stopping ntfy.service ..."
if [ -x /usr/bin/deb-systemd-invoke ]; then
deb-systemd-invoke stop 'ntfy.service' >/dev/null || true
else
systemctl stop ntfy >/dev/null 2>&1 || true
fi
fi