#!/bin/sh
set -e
test $DEBIAN_SCRIPT_DEBUG && set -v -x

#DEBHELPER#

VERSION=$(dpkg-query -W -f='${Version}' libreswan-modules-dkms | sed -e 's/.*:\(.*\)/\1/' -e 's/\(.*\)-.*/\1/')

case "$1" in
    remove|upgrade)
	if [ -x /usr/sbin/dkms ]; then
	    echo "Removing all DKMS Modules"
	    dkms remove -m libreswan -v $VERSION --all > /dev/null
	    echo "Done."
	fi
    ;;
esac


