summaryrefslogtreecommitdiffstats
path: root/debian/knot.postrm
blob: 14b3d69b6291ea5e3d73298b7bc345b9f535aa2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -e

if test "$1" = "purge"; then
    state_dir=/var/lib/knot
    for db_name in "catalog" "confdb" "journal" "keys" "timers"; do
        rm -rf $state_dir/$db_name >/dev/null 2>&1 || true
    done
    rmdir $state_dir >/dev/null 2>&1 || true
    [ -e $state_dir/* ] && echo "Notice: there are still data in ${state_dir}, please check."

    dpkg-statoverride --remove /var/lib/knot >/dev/null 2>&1 || true
    dpkg-statoverride --remove /etc/knot/knot.conf >/dev/null 2>&1 || true
    dpkg-statoverride --remove /etc/knot >/dev/null 2>&1 || true

    deluser --quiet knot >/dev/null 2>&1 || true
fi

#DEBHELPER#

exit 0