-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmxinstall
executable file
·36 lines (33 loc) · 1014 Bytes
/
mxinstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
###############################################################################
# Program:
# MOXA Linux driver installer
#
# History:
# 2009/09/11
#
# Author:
# Ken Huang, [email protected]
#
# Discription:
# The script install and load the MOXA Linux driver.
#
###############################################################################
TARGET_DRIVER=mxu11x0
MXVER=`awk '{if($1=="Version" && $2=="Number:"){print $3}}' version.txt`
if lsmod | grep -q $TARGET_DRIVER ; then
echo "Found driver in system..."
echo "Unloading driver..."
rmmod $TARGET_DRIVER || exit 1
make clean
echo "Unload driver successfully."
echo ""
fi
if make install ; then
echo ""
echo "Loading driver..."
modprobe $TARGET_DRIVER || exit 1
echo "************************************************************************"
echo " MOXA UPort 11x0 series driver ver $MXVER loaded successfully."
echo "************************************************************************"
fi