#!/bin/bash

set -e

case "$1" in
    remove|upgrade)
        update-alternatives --remove xen-default /usr/lib/xen-@version@
        if [ -x "/etc/init.d/xen" ]; then
            invoke-rc.d xen stop || exit $?
        fi
    ;;

    deconfigure|failed-upgrade)
    ;;

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

#DEBHELPER#

exit 0
