#!/bin/sh
set -e

# If the package is removed, purged or installation is aborted, try to
# remove the default mountpoints.
#
# Failure to do so is not considered fatal, because they may be in use by
# the system administrator or some other daemon on the system.
if [ "$1" = remove -o "$1" = abort-install -o "$1" = purge ]; then
    rm -f /media/usb 2> /dev/null || :
    for i in 0 1 2 3 4 5 6 7; do
	rmdir /media/usb$i 2> /dev/null || :
    done
fi

# During purge, also remove the /etc/udev/rules.d/z60_usbmount.rules symlink
# if it exists.
if [ "$1" = purge -a -h /etc/udev/rules.d/z60_usbmount.rules ]; then
    rm -f /etc/udev/rules.d/z60_usbmount.rules
fi

#DEBHELPER#

exit 0
