#!/bin/sh
set -e

if [ "$1" = "purge" ] ; then
        rm -f /etc/default/gdm
        if [ -d /etc/gdm ]; then
                rmdir /etc/gdm/Init /etc/gdm/PreSession /etc/gdm/PostSession /etc/gdm/PostLogin /etc/gdm/Sessions /etc/gdm 2>/dev/null || true
        fi
        if [ -d /var/lib/gdm ]; then
                rm -r /var/lib/gdm
        fi
        if [ -d /var/log/gdm ]; then
                rm -r /var/log/gdm
        fi
        if getent passwd gdm >/dev/null; then
                if [ -x /usr/sbin/deluser ]; then
                        deluser --system gdm
                fi
        fi
        if getent group gdm >/dev/null; then
                if [ -x /usr/sbin/delgroup ]; then
                        delgroup --system gdm
                fi
        fi
fi
#DEBHELPER#
exit 0
