#!/bin/sh
# postrm script for authentic2
#
# see: dh_installdeb(1)

set -e

case "$1" in purge)
    deluser --quiet --system authentic > /dev/null || true
    rm -f /etc/authentic2/secret
    rm -rf /var/lib/authentic2/static/*
    # source debconf stuff
    . /usr/share/debconf/confmodule
    # source dbconfig-common shell library, and call the hook function
    if [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql ]; then
        . /usr/share/dbconfig-common/dpkg/postrm.pgsql 
        dbc_go authentic2 $@
    fi

    DBCONF=/etc/authentic2/db.conf
    if [ "$1" = "purge" ]; then
        rm -f $DBCONF
        if which ucf >/dev/null 2>&1; then
            ucf --purge $DBCONF
        fi
    fi
    ;;

esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
