#!/bin/sh
set -eu
case "$1" in remove|purge)
 rm -f /usr/share/xsessions/dsigns.desktop /etc/sudoers.d/dsigns-reboot
 if [ -f /etc/lightdm/lightdm.conf.d/90-dsigns.conf ] && head -n 1 /etc/lightdm/lightdm.conf.d/90-dsigns.conf | grep -qx '# Managed by dsigns'; then
  rm /etc/lightdm/lightdm.conf.d/90-dsigns.conf
 fi
 echo 'dsigns removed. The signage account, media cache and device identity are retained.'
 ;; esac
