1
0
mirror of https://github.com/SuperBFG7/ympd synced 2025-10-25 19:07:41 +00:00

Fix: remove systemd service on uninstall

This commit is contained in:
jcorporation
2018-09-17 18:53:10 +01:00
parent 4c5bb30c8c
commit ebb6a607e9
4 changed files with 31 additions and 9 deletions

2
debian/postinst vendored
View File

@@ -28,7 +28,9 @@ then
if [ contrib/mympd.service -nt /usr/lib/systemd/system/mympd.service ]
then
cp contrib/mympd.service /usr/lib/systemd/system/
systemctl daemon-reload
fi
systemctl enable mympd
fi
# move config into place unless already existing

14
debian/postrm vendored
View File

@@ -1,5 +1,17 @@
if [ -f /usr/lib/systemd/system/mympd.service ]
then
if `systemctl is-active --quiet mympd`
then
echo "stopping mympd.service" && systemctl stop mympd
fi
echo "disabling mympd.service" && systemctl disable mympd
rm -v -f /usr/lib/systemd/system/mympd.service
systemctl daemon-reload
fi
rm -v -fr /var/lib/mympd
rm -v -f /usr/lib/systemd/system/mympd.service
[ -e /usr/share/mympd/htdocs/library ] && rm -v /usr/share/mympd/htdocs/library
rmdir -v /usr/share/{mympd/htdocs/,mympd/}
getent passwd mympd > /dev/null