#!/bin/sh -e

if [ "$1" = remove ]; then
    rm -rf /var/lib/unbound
    deluser --quiet unbound >/dev/null || true
fi

if [ "$1" = purge ]; then
    rm -f /etc/unbound/unbound_control.key \
        /etc/unbound/unbound_control.pem \
        /etc/unbound/unbound_server.key \
        /etc/unbound/unbound_server.pem
    rm -f /var/lib/unbound/root.key
fi

#DEBHELPER#
