CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/cache/sources/linuxpg/pgload.sh
Views: 3959
1
#!/bin/sh
2
# pgload, v2.1 2011/09/23
3
module="pgdrv"
4
#mode="664"
5
6
# check whrther the kernel is valid or not
7
#version1=`uname -r | cut -d '.' -f 1`
8
#version2=`uname -r | cut -d '.' -f 2`
9
#version3=`uname -r | cut -d '.' -f 3`
10
#version3=${version3%%-*}
11
#if [ "$version1" != "2" ] || [ "$version2" != "6" ] ; then
12
# echo " Your version of kernel is `uname -r`"
13
# echo " The kernel is too outdated to be used."
14
# echo " Please update the version to 2.6.16 or later."
15
# exit 1
16
#elif test $version3 -lt 11 ; then
17
# echo " Your version of kernel is `uname -r`"
18
# echo " The kernel is outdated."
19
# echo " Please update the version to 2.6.11 or later."
20
#fi
21
22
# invoke insmod with all arguments we got
23
# and use a pathname, as insmod doesn't look in . by default
24
check=`lsmod | grep r8169`
25
if [ "$check" != "" ]; then
26
echo "rmmod r8169"
27
/sbin/rmmod r8169
28
fi
29
30
check=`lsmod | grep r8168`
31
if [ "$check" != "" ]; then
32
echo "rmmod r8168"
33
/sbin/rmmod r8168
34
fi
35
36
check=`lsmod | grep r8125`
37
if [ "$check" != "" ]; then
38
echo "rmmod r8125"
39
/sbin/rmmod r8125
40
fi
41
42
check=`lsmod | grep r8101`
43
if [ "$check" != "" ]; then
44
echo "rmmod r8101"
45
/sbin/rmmod r8101
46
fi
47
48
check=`lsmod | grep $module`
49
if [ "$check" != "" ]; then
50
echo "$module has existed."
51
echo "$check"
52
exit 1
53
else
54
if test -e ./$module.ko ; then
55
echo "insmod $module.ko $*"
56
/sbin/insmod ./$module.ko $* || exit 1
57
else
58
echo "make clean all"
59
make clean all 1>/dev/null
60
if test -e ./$module.ko ; then
61
echo "insmod $module.ko $*"
62
/sbin/insmod ./$module.ko $* || exit 1
63
else
64
echo "$module.ko doesn't exist."
65
exit 1
66
fi
67
fi
68
fi
69
70
exit 0
71
72