aboutsummaryrefslogtreecommitdiff
path: root/debian/taler-exchange.postrm
blob: fcde84b58d096e0e3cf7d9879e84dee833777c6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

set -e

_GROUPNAME=taler-exchange-secmod
_DBGROUPNAME=taler-exchange-db
_EUSERNAME=taler-exchange-httpd
_CLOSERUSERNAME=taler-exchange-closer
_CSECUSERNAME=taler-exchange-secmod-cs
_RSECUSERNAME=taler-exchange-secmod-rsa
_ESECUSERNAME=taler-exchange-secmod-eddsa
_AGGRUSERNAME=taler-exchange-aggregator
_EXPIUSERNAME=taler-exchange-expire
_WIREUSERNAME=taler-exchange-wire


if [ -f /usr/share/debconf/confmodule ]; then
  . /usr/share/debconf/confmodule
fi

case "${1}" in
purge)
    rm -rf /var/lib/taler/exchange-offline /var/lib/taler/exchange-secmod-*
    dpkg-statoverride --remove \
       /etc/taler/secrets/exchange-accountcredentials-1.secret.conf || true
    dpkg-statoverride --remove \
                      /etc/taler/secrets/exchange-db.secret.conf || true
    deluser --quiet --system ${_CSECUSERNAME} || true
    deluser --quiet --system ${_RSECUSERNAME} || true
    deluser --quiet --system ${_ESECUSERNAME} || true
    deluser --quiet --system ${_AGGRUSERNAME} || true
    deluser --quiet --system ${_EXPIUSERNAME} || true
    deluser --quiet --system ${_WIREUSERNAME} || true
    deluser --quiet --system ${_CLOSERUSERNAME} || true
    deluser --quiet --system ${_EUSERNAME} || true
    delgroup --only-if-empty --quiet ${_DBGROUPNAME} || true
    delgroup --only-if-empty --quiet ${_GROUPNAME} || true
    ;;

remove | upgrade | failed-upgrade | abort-install | abort-upgrade | disappear)
    ;;
*)
    echo "postrm called with unknown argument \`${1}'" >&2
    exit 1
    ;;
esac

#DEBHELPER#

exit 0