/
rpi
executable file
·44 lines (39 loc) · 1007 Bytes
/
rpi
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
#/bin/bash
CHOICE=$(whiptail --title "Smarter Lock Raspberry Pi Config Tool" --menu "Please choose an option" 15 70 7 \
"Run GUI & Srv" "Run the server piped with GUI's stdout." \
"Run Server" "Run the server." \
"Run APNS" "Run the APN server." \
"Install Deps" "Install cmake, opencv, openssl, nodejs, npm." \
"Link Pi Config" "Create soft link for config_pi.ini." \
"Build Server" "Build the server." \
"Build APNS" "Build the APN server." \
3>&1 1>&2 2>&3)
case "$CHOICE" in
"Run Server")
sudo ./Server/piserver
;;
"Run GUI & Srv")
python gui/main.py | sudo Server/piserver
;;
"Run APNS")
cd apns
npm start
;;
"Install Deps")
sudo apt-get update
sudo apt-get install cmake libopencv-dev libssl-dev nodejs npm
;;
"Link Pi Config")
ln -s ./Server/config_pi.ini ./Server/config.ini
;;
"Build Server")
cd Server
./build_server
;;
"Build APNS")
cd apns
npm install
cd cppglue
./buildlib
;;
esac