#!/bin/sh

set -e

VERSION=%VERSION%

case $1 in
    purge)
        if test -d "/etc/orthanc"; then
            rmdir --ignore-fail-on-non-empty "/etc/orthanc" || true
        fi

        # Remove the "orthanc" user
        if getent passwd orthanc >/dev/null; then
                if [ -x /usr/sbin/deluser ]; then
                        deluser --system orthanc
                fi
        fi
        if getent group orthanc >/dev/null; then
                if [ -x /usr/sbin/delgroup ]; then
                        delgroup --system orthanc
                fi
        fi
esac

#DEBHELPER#
