Update DEB install scripts to use systemd scriptlets

This commit is contained in:
Gamerboy59 2024-09-10 21:59:34 +02:00 committed by GitHub
commit 9a1fbe8bee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 41 additions and 23 deletions

View file

@ -1,17 +1,22 @@
#!/bin/bash
#!/bin/sh
set -e
# Remove the rpxy user and configuration directory only if purging the package
if [ "$1" = "purge" ]; then
if id rpxy >/dev/null 2>&1; then
userdel rpxy
# Remove the rpxy user
if getent passwd rpxy >/dev/null; then
deluser --quiet --system rpxy >/dev/null || true
fi
# Remove config directory
if [ -d /etc/rpxy ]; then
rm -rf /etc/rpxy
fi
rm -rf /etc/rpxy
# Remove systemd service state
deb-systemd-helper purge rpxy.service >/dev/null || true
deb-systemd-helper unmask rpxy.service >/dev/null || true
fi
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
fi
exit 0