#!/bin/sh

set -e

#DEBHELPER#
. /usr/share/debconf/confmodule

case "$1" in
    upgrade)
        if dpkg --compare-versions "${2}" le-nl "0.2-0ubuntu1"
        then
                db_input high ipod/clear_mount || true
                db_go
                db_get ipod/mountpoint
                mountpoint="$RET"
                db_get ipod/clear_mount
                clear="$RET"
                if [ "$clear" = "true" ]; then
                        rm -rf $mountpoint/*
                fi
        fi
        ;;
esac

