#!/bin/sh

# Abort if any command returns an error value
set -e

CFGFILE=/etc/fred/whois.conf
CFGAPACHE=/etc/apache2/sites-available/whois.conf

if [ "$1" = "purge" ]; then
    for ext in '~' '%' .bak .ucf-new .ucf-old .ucf-dist;  do
        rm -f ${CFGFILE}$ext;
    done

    # remove the configuration file itself
    rm -f ${CFGFILE}
	    
    if which ucf >/dev/null; then
        ucf --purge ${CFGFILE}
    fi
    if which ucfr >/dev/null; then
        ucfr --purge fred-whois ${CFGFILE}
    fi
fi

#DEBHELPER#
