#!/bin/bash
# postrm script for dinit-service-xrdp.

set -e

SERVICE1="xrdp"
SERVICE2="xrdp-sesman"

case "$1" in
    remove|purge)
		##### GLOBAL SERVICES #####
		if test -e /etc/dinit.d/boot.d/$SERVICE1; then
			echo "Removing $SERVICE1 from boot"
			rm -rf /etc/dinit.d/boot.d/$SERVICE1
		fi
		if test -e /etc/dinit.d/boot.d/$SERVICE2; then
			echo "Removing $SERVICE2 from boot"
			rm -rf /etc/dinit.d/boot.d/$SERVICE2
		fi
	;;
	
    upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    ;;

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

exit 0
