-
Notifications
You must be signed in to change notification settings - Fork 0
/
hackathon-setup.sh
75 lines (61 loc) · 1.84 KB
/
hackathon-setup.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
66
67
68
69
70
71
72
73
74
#
# Title: hackathon-setup .sh
# Author: Fabio Bertagna
# Date created: Fri 28 Dec 2018 10:16:34 PM CET
# Comment: Setup Raspberry Pi for SunFounder PiCar-S and PiCar-V
#!/bin/bash
wget -q --tries=10 --timeout=20 --spider http://google.com
if [[ $? -eq 0 ]]; then
echo "Working internet connection confirmed"
else
echo "Offline"
exit 1
fi
if [ "$(ls | grep READY)" = "READY" ];
then
exit 1
fi
sudo echo "LC_ALL=en_US.UTF-8" >> sudo /etc/environment
sudo echo "en_US.UTF-8 UTF-8" >> sudo /etc/locale.gen
sudo echo "LANG=en_US.UTF-8" > sudo /etc/locale.conf
sudo locale-gen en_US.UTF-8
sudo echo "export LC_ALL=C" >> sudo ~/.bashrc
sudo echo "alias ll='ls -la'" >> sudo ~/.bashrc
source ~/.bashrc
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade
sudo apt-get install vim git -y
git clone https://github.com/DonGiovanni83/raspberry-pi-setup.git
sudo apt-get install python-pip -y
pip install setuptools
echo "For which robot do you want to set up your Raspberry Pi?"
options=("PiCar-S" "PiCar-V" "Cancel")
select opt in "${options[@]}"
do
case $opt in
"PiCar-S")
#PiCar-S setup
echo "Setting things up for PiCar-S...."
git clone --recursive https://github.com/sunfounder/SunFounder_PiCar-S.git
cd SunFounder_PiCar-S
sudo ./install_dependencies
cd ~
;;
"PiCar-V")
#PiCar-V setup
echo "Setting things up for PiCar-V...."
git clone https://github.com/sunfounder/SunFounder_PiCar-V.git
cd SunFounder_PiCar-V
sudo ./install_dependencies
cd ~
;;
"Cancel")
break
;;
*) echo "invalid option $REPLY";;
esac
done
./raspberry-pi-setup/WifiSetup/main.sh
sudo touch READY
#//hackathon-setup .sh