#!/bin/sh
# postrm script for recovery-tools-6.11
#
# by Luigi Cotignano
# http://n900.altervista.org

# summary of how this script can be called:
#        * <postrm> `remove'
#        * <postrm> `purge'
#        * <old-postrm> `upgrade' <new-version>
#        * <new-postrm> `failed-upgrade' <old-version>
#        * <new-postrm> `abort-install'
#        * <new-postrm> `abort-install' <old-version>
#        * <new-postrm> `abort-upgrade' <old-version>
#        * <disappearer's-postrm> `disappear' <overwriter>
#          <overwriter-version>
case "$1" in
    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    echo "Removing TestDisk and PhotoRec symlinks..."
    if [ -h /usr/bin/photorec ]
    then
	rm -f /usr/bin/photorec
    fi

    if [ -h /usr/bin/testdisk ]
    then
	rm -f /usr/bin/testdisk
    fi

    if [ -f /usr/bin/photorec.ses ]
    then
	rm -f /usr/bin/photorec.ses
    fi

    echo "Removing TestDisk and PhotoRec executables..."
    if [ -f /opt/recovery-tools/photorec ]
    then
      rm -f /opt/recovery-tools/photorec
    fi

    if [ -f /opt/recovery-tools/testdisk ]
    then
      rm -f /opt/recovery-tools/testdisk
    fi

    echo "TestDisk and PhotoRec for Nokia N900 has been removed successfully."
    ;;

    *)
        echo "Error: unable to remove TestDisk and PhotoRec" >&2
        exit 1
    ;;
esac
#DEBHELPER#

exit 0


