-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.sh
executable file
·58 lines (49 loc) · 1.36 KB
/
build.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
#!/bin/bash
# Author: Matt Bunting
echo "--------------------------------------------------------"
echo "Installing libpanda:"
PI_USER=$(cat /etc/libpanda.d/libpanda_usr)
#build dependencies:
declare -a depencencies=(build-essential libncurses5-dev libusb-1.0-0-dev libjsoncpp-dev cmake)
toInstall=()
echo "Dependencies:" ${depencencies[@]}
for dependency in "${depencencies[@]}"
do
echo "Checking for" $dependency
if [ $(dpkg-query -W -f='${Status}' $dependency 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
echo "not installed:" $dependency
toInstall+=($dependency)
fi
done
echo ${toInstall[@]}
if [ ${#toInstall[@]} -ne 0 ];
then
sudo apt-get update
sudo apt-get install -y ${toInstall[@]}
fi
if [ ! -d "build" ];
then
mkdir build
fi
cd build
cmake ..
make -j4
sudo make install
cd ..
# Install panda services:
cd scripts/panda
sudo ./install.sh
cd ../..
# Install configuration files and welcome msg
cd scripts/
#cp irsyncCyverse.sh /home/${SUDO_USER}/irsyncCyverse.sh
#cp irsyncCyverse.sh /home/$PI_USER/irsyncCyverse.sh
#sudo cp irsyncCyverse.sh /usr/local/sbin/irsyncCyverse
cp gosyncCyverse.sh /home/$PI_USER/gosyncCyverse.sh
sudo cp gosyncCyverse.sh /usr/local/sbin/gosyncCyverse
#cp setVin.sh /home/${SUDO_USER}/setVin.sh
sudo cp 99-libpanda.sh /etc/profile.d/99-libpanda.sh
cd ..
echo "Done."
echo "--------------------------------------------------------"