-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·58 lines (52 loc) · 1.25 KB
/
install.sh
File metadata and controls
executable file
·58 lines (52 loc) · 1.25 KB
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
#!/usr/bin/bash
set -e
set -u
set -o pipefail
CLIENT=true;
SERVER=false;
HOST="";
while getopts 'h:o' OPTION; do
case "$OPTION" in
h)
SERVER=true
HOST=$OPTARG
;;
o)
CLIENT=false;
SERVER=true;
;;
?)
cat << EOM
This is the installation script for the CCGS RoboHUD GUI stack.
From here, you can install the client and/or the server.
Script usage:
$(basename "$0") [-h HOST] [-d DIRECTORY] [-o]
The -h option is the host to clone to, which is only needed if you are\
installing the robot. The hostname you are most likely to encounter is\
pi@192.168.100.1, but this may change over time.
The -o option only installs the server, which may be useful when creating a\
new robot or updating the server, without the need to change the client.
The following code:
$(basename "$0") -h pi@192.168.100.1
Would install the code on both the robot and the client
EOM
exit 1
;;
esac
done
shift "$((OPTIND -1))"
if $CLIENT; then
git clone https://github.com/CCGSRobotics/RoboHUD.git
curl -o- -L https://yarnpkg.com/install.sh | bash
cd RoboHUD/ && yarn
cd ..
fi
if $SERVER; then
if [[ -d "RoboHUD" ]]; then
cd RoboHUD/
else
echo "$PWD"
fi
cd Server && yarn && cd ..
scp -r Server/ "$HOST":
fi