Add #201: Add an action to change the trusted-cas-file for a section
[privoxy.git] / debian / postrm
1 #! /bin/sh
2 # postrm script for privoxy
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 # summary of how this script can be called:
9 #        * <postrm> `remove'
10 #        * <postrm> `purge'
11 #        * <old-postrm> `upgrade' <new-version>
12 #        * <new-postrm> `failed-upgrade' <old-version>
13 #        * <new-postrm> `abort-install'
14 #        * <new-postrm> `abort-install' <old-version>
15 #        * <new-postrm> `abort-upgrade' <old-version>
16 #        * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
17 # for details, see http://www.debian.org/doc/debian-policy/ or
18 # the debian-policy package
19
20
21 case "$1" in
22     purge)
23         # deluser --quiet privoxy
24         for ext in .ucf-new .ucf-old .ucf-dist ""; do
25                 rm -f "/etc/privoxy/config$ext"
26         done
27         if [ -x "$(command -v ucf)" ]; then
28             ucf --purge /etc/privoxy/config
29         fi
30         if [ -x "$(command -v ucfr)" ]; then
31             ucfr --purge privoxy /etc/privoxy/config
32         fi
33         rm -rf /var/log/privoxy
34         if [ -e /usr/share/debconf/confmodule ]; then
35             . /usr/share/debconf/confmodule
36             db_purge
37         fi
38         # Remove https inspection certificates on purge:
39         if [ -d /var/lib/privoxy/certs ]; then
40             rm -rf /var/lib/privoxy/certs
41         fi
42         ;;
43
44     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
45         ;;
46
47     *)
48         echo "postrm called with unknown argument \`$1'" >&2
49         exit 1
50
51 esac
52
53 # dh_installdeb will replace this with shell code automatically
54 # generated by other debhelper scripts.
55
56 #DEBHELPER#
57
58 exit 0