#!/bin/sh

if [ -f "/tmp/MailStation.upgrade" ]; then
	exit 0
fi

case "$SYNOPKG_PKG_STATUS" in
	UNINSTALL)
		su -l postgres -c "/usr/bin/dropdb roundcubemail"
		su -l postgres -c "/usr/bin/dropuser roundcube"
		kill `cat /var/services/homes/*/.Maildir/fetchmail.pid`
		;;
	UPGRADE)
		;;
esac

exit 0
