-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathinstall.sh
65 lines (50 loc) · 1.36 KB
/
install.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
red=$(tput setaf 1)
grn=$(tput setaf 2)
NC=$(tput sgr 0) # No Color
yell() { echo "$0: $*" >&2; }
die() { yell "$*"; exit 111; }
try() { "$@" || die "$red Cannot $* $NC"; }
if [ -z $1 ]
then
echo -e $(red)Provide an install path !!!$(NC)
return 1
fi
if [ ! -d $1 ]
then
mkdir -p $1
fi
if [ -d $1 ]
then
echo "$grn"
echo "Welcome to ivcam basic IVCAM DLL installer $grn"
echo "To continue you need your$red sudo$grn password$NC"
GU=$(groups | cut -f1 -d ' ')
echo SUBSYSTEMS==\"usb\", MODE=\"666\", GROUP=\"$GU\" | sudo tee /etc/udev/rules.d/48-usb.rules > /dev/null
echo $grn
sudo chmod -R 777 lib
sudo chmod -R 777 include
echo Copying ivcam library include files
mkdir -p $1/include
cp -v ./include/* $1/include/.
sudo mkdir /usr/include/ivcam
sudo cp -r ./include/* /usr/include/ivcam
echo Installing ivcamlib
try sudo cp -v ./lib/libivcam.so /usr/lib/.
echo "Installing USB DLL for IVCAM"
#try sudo apt-get install libusb-dev
echo "Copying ivcam sample app sources to $1/ivcamsample/"
mkdir -p $1/ivcamsample/
try cp -v ./ivcamsample/ivcam_sample.cc $1/ivcamsample/.
try cp -v ./ivcamsample/build.sh $1/ivcamsample/.
echo "Building ivcam_sample"
cd $1/ivcamsample
. ./build.sh
cd $OLDPWD
echo Done!!
echo $red
echo Please reboot your system now
else
echo "$redCan not create or read install directory !!"
fi
echo $NC