add ntfy-client.service as user service

This commit is contained in:
da
2024-01-15 22:06:46 +01:00
parent bb4b5d2bc8
commit b6983e6866
4 changed files with 35 additions and 36 deletions

View File

@@ -24,6 +24,7 @@ if [ "$1" = "configure" ] || [ "$1" -ge 1 ]; then
# Restart services
systemctl --system daemon-reload >/dev/null || true
systemctl --user daemon-reload >/dev/null || true
if systemctl is-active -q ntfy.service; then
echo "Restarting ntfy.service ..."
if [ -x /usr/bin/deb-systemd-invoke ]; then
@@ -33,12 +34,20 @@ if [ "$1" = "configure" ] || [ "$1" -ge 1 ]; then
fi
fi
if systemctl is-active -q ntfy-client.service; then
echo "Restarting ntfy-client.service ..."
echo "Restarting ntfy-client.service (system) ..."
if [ -x /usr/bin/deb-systemd-invoke ]; then
deb-systemd-invoke try-restart ntfy-client.service >/dev/null || true
else
systemctl restart ntfy-client.service >/dev/null || true
fi
fi
if systemctl --user is-active -q ntfy-client.service; then
echo "Restarting ntfy-client.service (user)..."
if [ -x /usr/bin/deb-systemd-invoke ]; then
deb-systemd-invoke --user try-restart ntfy-client.service >/dev/null || true
else
systemctl --user restart ntfy-client.service >/dev/null || true
fi
fi
fi
fi