-
Notifications
You must be signed in to change notification settings - Fork 0
/
hotspot-install.sh
99 lines (96 loc) · 3.61 KB
/
hotspot-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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
# Convenient hotspot-game hotspot-install.sh script written by Claude Pageau 1-Jul-2016
ver="1.2"
GAME_DIR='hotspot-game' # Default folder install location
cd ~
if [ -d "$GAME_DIR" ] ; then
STATUS="Upgrade"
echo "Upgrade hotspot-game files"
else
echo "New hotspot-game Install"
STATUS="New Install"
mkdir -p $GAME_DIR
echo "$GAME_DIR Folder Created"
fi
cd $GAME_DIR
INSTALL_PATH=$( pwd )
# Remember where this script was launched from
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "------------------------------------------------"
echo " hotspot-Install.sh script ver $ver"
echo " $STATUS hotspot-game for Object speed tracking"
echo "------------------------------------------------"
echo ""
echo "1 - Downloading GitHub Repo files to $INSTALL_PATH"
wget -O hotspot-install.sh -q --show-progress https://raw.github.com/pageauc/hotspot-game/master/hotspot-install.sh
if [ $? -ne 0 ] ; then
wget -O hotspot-install.sh https://raw.github.com/pageauc/hotspot-game/master/hotspot-install.sh
wget -O hotspot-game.py https://raw.github.com/pageauc/hotspot-game/master/hotspot-game.py
wget -O config.py https://raw.github.com/pageauc/hotspot-game/master/config.py
wget -O Readme.md https://raw.github.com/pageauc/hotspot-game/master/Readme.md
else
wget -O hotspot-game.py -q --show-progress https://raw.github.com/pageauc/hotspot-game/master/hotspot-game.py
wget -O config.py -q --show-progress https://raw.github.com/pageauc/hotspot-game/master/config.py
wget -O Readme.md -q --show-progress https://raw.github.com/pageauc/hotspot-game/master/Readme.md
fi
echo "Done Download"
echo "------------------------------------------------"
echo ""
echo "2 - Make required Files Executable"
chmod +x hotspot-game.py
chmod +x hotspot-install.sh
echo "Done Permissions"
echo "------------------------------------------------"
# check if system was updated today
NOW="$( date +%d-%m-%y )"
LAST="$( date -r /var/lib/dpkg/info +%d-%m-%y )"
if [ "$NOW" == "$LAST" ] ; then
echo "4 Raspbian System is Up To Date"
echo ""
else
echo ""
echo "3 - Performing Raspbian System Update"
echo " This Will Take Some Time ...."
echo ""
sudo apt-get -y update
echo "Done update"
echo "------------------------------------------------"
echo ""
echo "4 - Performing Raspbian System Upgrade"
echo " This Will Take Some Time ...."
echo ""
sudo apt-get -y upgrade
echo "Done upgrade"
fi
echo "------------------------------------------------"
echo ""
echo "5 - Installing hotspot-game Dependencies"
sudo apt-get install -y python-opencv python-picamera
sudo apt-get install -y fonts-freefont-ttf # Required for Jessie Lite Only
echo "Done Dependencies"
cd $DIR
# Check if hotspot-install.sh was launched from hotspot-game folder
if [ "$DIR" != "$INSTALL_PATH" ]; then
if [ -e 'hotspot-install.sh' ]; then
echo "$STATUS Cleanup hotspot-install.sh"
rm hotspot-install.sh
fi
fi
echo "-----------------------------------------------"
echo "6 - $STATUS Complete"
echo "-----------------------------------------------"
echo ""
echo "1. Reboot RPI if there are significant Raspbian system updates"
echo "2. Raspberry pi needs a monitor/TV attached to display game window"
echo "3. Run hotspot-game.py with the Raspbian Desktop GUI running"
echo "4. To start game open file manager or a Terminal session then change to"
echo " hotspot-game folder and launch per commands below"
echo ""
echo " cd ~/hotspot-game"
echo " ./hotspot-game.py"
echo ""
echo "-----------------------------------------------"
echo "See Readme.md for Further Details"
echo $GAME_DIR "Good Luck Claude ..."
echo "Bye"
echo ""