summaryrefslogtreecommitdiff
path: root/debian/taler-exchange.postrm
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-28 11:39:05 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-28 11:39:05 +0100
commit351b289675cc9a52a86f5daedd430942d680c410 (patch)
tree9b27178c1945d9717143a2e1ff08c9eecd898af0 /debian/taler-exchange.postrm
parente550acf5779f8b5da31bc97b35f77ff3f1935c0b (diff)
downloadexchange-351b289675cc9a52a86f5daedd430942d680c410.tar.gz
exchange-351b289675cc9a52a86f5daedd430942d680c410.tar.bz2
exchange-351b289675cc9a52a86f5daedd430942d680c410.zip
skeleton for Taler exchange Debian package (not yet working)
Diffstat (limited to 'debian/taler-exchange.postrm')
-rw-r--r--debian/taler-exchange.postrm63
1 files changed, 63 insertions, 0 deletions
diff --git a/debian/taler-exchange.postrm b/debian/taler-exchange.postrm
new file mode 100644
index 000000000..2807d737a
--- /dev/null
+++ b/debian/taler-exchange.postrm
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+set -e
+
+pathfind() {
+ OLDIFS="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if [ -x "$p/$*" ]; then
+ IFS="$OLDIFS"
+ return 0
+ fi
+ done
+ IFS="$OLDIFS"
+ return 1
+}
+
+case "${1}" in
+ purge)
+ if [ -e /usr/share/debconf/confmodule ]
+ then
+ . /usr/share/debconf/confmodule
+ db_version 2.0
+
+ db_get taler-systempeer/username
+ _USERNAME="${RET:-taler}"
+
+ db_get taler-systempeer/groupname
+ _GROUPNAME="${RET:-taler}"
+ else
+ _USERNAME="taler"
+ _GROUPNAME="taler"
+ fi
+
+ TALERDNS_GROUP="talerdns"
+
+ if pathfind deluser
+ then
+ deluser --quiet --system ${_USERNAME} || true
+ fi
+
+ if pathfind delgroup
+ then
+ delgroup --quiet --system --only-if-empty ${_GROUPNAME} || true
+ delgroup --quiet --system --only-if-empty ${TALERDNS_GROUP} || true
+ fi
+
+ rm -rf /var/log/taler/ /var/lib/taler /etc/default/taler
+ ;;
+
+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0