#!/bin/sh

set -e

#PKGOS-INCLUDE#

if [ "${1}" = "purge" ] ; then
	pkgos_dbc_postrm cloudkitty cloudkitty-common $@

	[ -e /var/lib/cloudkitty ] && rm -rf /var/lib/cloudkitty
	[ -e /var/log/cloudkitty ] && rm -rf /var/log/cloudkitty
	for i in cloudkitty.conf api_paste.ini policy.json ; do
		if [ -e "/etc/cloudkitty/${i}" ] ; then
			rm /etc/cloudkitty/${i}
		fi
	done
	rm -f /etc/cloudkitty/metrics.yml
	rmdir --ignore-fail-on-non-empty /etc/cloudkitty || true
fi

#DEBHELPER#
