summaryrefslogtreecommitdiffstats
path: root/debian/deluged.postrm
diff options
context:
space:
mode:
Diffstat (limited to 'debian/deluged.postrm')
-rwxr-xr-xdebian/deluged.postrm42
1 files changed, 42 insertions, 0 deletions
diff --git a/debian/deluged.postrm b/debian/deluged.postrm
new file mode 100755
index 0000000..cca1ab9
--- /dev/null
+++ b/debian/deluged.postrm
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+DELUGE_USER="debian-deluged"
+DELUGE_GROUP="debian-deluged"
+
+Remove_overrides ()
+{
+ for FILENAME in "${@}"
+ do
+ if dpkg-statoverride --list "${FILENAME}" > /dev/null 2>&1
+ then
+ dpkg-statoverride --remove "${FILENAME}"
+ fi
+ done
+}
+
+case "${1}" in
+ purge)
+ rm -f /var/log/deluged/*
+ rm -rf /var/lib/deluged/config/*
+
+ Remove_overrides /var/log/deluged /var/lib/deluged /var/lib/deluged/config
+
+ userdel ${DELUGE_USER} > /dev/null 2>&1 || true
+ groupdel ${DELUGE_GROUP} > /dev/null 2>&1 || true
+ ;;
+
+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0