#!/bin/sh
###############################################################################
# Program:
# 		MOXA Linux driver installer
#	
# History:
# 2008/03/06
#
# Author:
# Eric Lo, eric.lo@moxa.com
#
# Discription:
# The script install and load the MOXA Linux driver.
#
###############################################################################

TARGET_DRIVER=mxuport2000
MXVER=1.1

if lsmod | grep -q $TARGET_DRIVER ; then
	echo "Found driver in system..."
	echo "Unloading driver..."
	rmmod $TARGET_DRIVER
	echo "Unload driver successfully."
	echo ""
fi

if make install ; then
	echo ""
	echo "Loadning driver..."
	modprobe $TARGET_DRIVER
	echo "**********************************************************************"
	echo " MOXA UPort 2000 series driver ver $MXVER loaded successfully."
	echo "**********************************************************************"
fi
