#!/bin/sh
set -e

# Get the package version
package=mlnx-en
version=`dpkg-query -W -f='${Version}' "$package-dkms" \
    | sed -e 's/[+-].*//'`

isadded=`dkms status -m "$name" -v "$version"`

if [ "x${isadded}" = "x" ] ; then
    dkms add -m "$package" -v "$version"
fi

if [ "$1" = 'configure' ] ; then
    dkms build -m "$package" -v "$version" && dkms install -m "$package" -v "$version" --force || true
fi

#DEBHELPER#

exit 0
