#!/bin/sh

set -e

NAME=psb-kernel-source
VERSION=$(dpkg-query -W -f='${Version}' $NAME | awk -F "-" '{print $1}' | cut -d\: -f2)

case "$1" in
    purge|remove|failed-upgrade|abort-install|abort-upgrade|disappear)
		moddir="/lib/modules/`uname -r`/kernel/"
      depmod
      update-initramfs -u
#      if [ -d "/usr/src/$NAME-$VERSION" ]; then
#         echo "Removing old module source..."
#         rm -rf "/usr/src/$NAME-$VERSION"
#      fi
    ;;

    install|upgrade)
	moddir="/lib/modules/`uname -r`/kernel/"
	depmod
	update-initramfs -u
    ;;
    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0

