#!/bin/bash
#
# Install Script for the Rockey4 Driver.
#
#

echo
echo Installing Rockey4 Driver...
echo

#check whether the current user is root
if test $(id -ur) != 0; then
	echo
	echo "You should logon as root user!"
	echo 
	exit -1
fi

#
# check if module for this Kernel version exists
#

if [ -f Makefile ]; then
 make clean;make;make install
 if [ $? != 0 ]; then
  echo Could not copy driver-module, exiting
  exit -1
 fi
 modprobe rockey > /dev/null
fi

echo
echo Installation finished
