#!/bin/sh

set -e

package=robotnik
name=robotnik

# __VERSION__ is replaced by the actual version in overrride_dh_auto_install in
# the rules
version="__VERSION__"

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

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

if [ "$1" = 'configure' ] ; then
  /usr/lib/dkms/common.postinst "$name" "$version"
fi

if lsmod | grep "$name"; then
  echo "robotnik driver updated. Please reboot or run 'rmmod robotnik; modprobe robotnik' to load new driver"
fi

#DEBHELPER#

exit 0
