-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfix_usb.sh
executable file
·64 lines (49 loc) · 1.4 KB
/
fix_usb.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
#!/bin/bash
function check_n_exec(){
echo "The following command will be executed:"
mycommand=$1
echo $mycommand
read -p "Are you sure (y/n)? " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
eval $mycommand
}
INSTALLPATH=Installation
PreInstall=PreInstallThis
SOURCEFILES=installation_files
ROOTPATH=$( pwd )
sleeptime=2
check_n_exec "sudo rm -r $INSTALLPATH/$PreInstall"
mkdir -p $INSTALLPATH/$PreInstall
cd $ROOTPATH/$SOURCEFILES
tar -C $ROOTPATH/$INSTALLPATH/$PreInstall -xvf $( /bin/ls CAENComm* | grep -e ".tgz" -e ".tar.gz")
tar -C $ROOTPATH/$INSTALLPATH/$PreInstall -xvf $( /bin/ls CAENVMELib* | grep -e ".tgz" -e ".tar.gz")
tar -C $ROOTPATH/$INSTALLPATH/$PreInstall -xvf $( /bin/ls CAENUSB* | grep -e ".tgz" -e ".tar.gz")
#installing requirements
echo ""
echo "Installing CAENVMELib"
cd $ROOTPATH/$INSTALLPATH/$PreInstall
cd $( /bin/ls | grep CAENVMELib* )/lib
sudo bash install_x64
echo "CAENVMELib hopefully installed, check for errors"
echo ""
sleep $sleeptime
echo "Installing CAENComm"
cd ../../
cd $( /bin/ls | grep CAENComm* )/lib
sudo bash install_x64
echo "CAENComm hopefully installed, check for errors"
echo ""
sleep $sleeptime
echo "Installing CAENUSB"
cd ../../
cd $( /bin/ls | grep CAENUSB* )
make
sudo make install
echo "CAENUSB hopefully installed, check for errors"
echo ""
sleep $sleeptime
cd $ROOTPATH