#!/bin/bash

CLEANUP_SUBDIRS="alembic conf salt salt-local venv"

case "$1" in
	remove)
		# clean up .pyc and other detritus
		for subdir in $CLEANUP_SUBDIRS ; do
			rm -rf /opt/calamari/$subdir
		done
		;;

	purge)
		# as above, plus logs and whisper data
		for subdir in $CLEANUP_SUBDIRS ; do
			rm -rf /opt/calamari/$subdir
		done
		rm -rf /var/log/graphite
		rm -rf /var/log/calamari
		rm -rf /var/lib/graphite
		;;

	upgrade|disappear|abort-install|abort-upgrade|disappear|failed-upgrade|abort-install|abort-upgrade)
		# just...no.
		;;

	*)
		echo "postrm called with unknown argument $1" >&2
		exit 1
		;;
esac

#DEBHELPER#

exit 0
