44
55SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd) "
66
7- SRC_VERSION=0.2.1
8-
9- function installRemoteControl() {
10- systemctl --user stop ssl-remote-control.service
11- mkdir -p ~ /.local/bin/
12- wget " https://github.com/RoboCup-SSL/ssl-remote-control/releases/download/v${SRC_VERSION} /ssl-remote-control_v${SRC_VERSION} _linux_arm" -O ~ /.local/bin/ssl-remote-control
13- chmod +x ~ /.local/bin/ssl-remote-control
14- systemctl --user start ssl-remote-control.service
15- }
7+ SRC_VERSION=${1-}
168
179function installService() {
1810 if [[ ! -f ~ /.local/share/systemd/user/ssl-remote-control.service ]]; then
@@ -22,9 +14,21 @@ function installService() {
2214 fi
2315}
2416
25- function installBrowser () {
26- sudo apt-get update
17+ function installRemoteControl () {
18+ sudo apt-get install --no-install-recommends -y curl jq
2719
20+ systemctl --user stop ssl-remote-control.service
21+ mkdir -p ~ /.local/bin/
22+ if [[ -z " ${SRC_VERSION} " ]]; then
23+ SRC_VERSION=" $( curl -s https://api.github.com/repos/RoboCup-SSL/ssl-remote-control/releases/latest | jq -r ' .tag_name' ) "
24+ fi
25+ echo " Installing version: ${SRC_VERSION} "
26+ wget " https://github.com/RoboCup-SSL/ssl-remote-control/releases/download/v${SRC_VERSION} /ssl-remote-control_v${SRC_VERSION} _linux_arm" -O ~ /.local/bin/ssl-remote-control
27+ chmod +x ~ /.local/bin/ssl-remote-control
28+ systemctl --user start ssl-remote-control.service
29+ }
30+
31+ function installBrowser() {
2832 # https://blog.r0b.io/post/minimal-rpi-kiosk/
2933 sudo apt-get install --no-install-recommends -y \
3034 xserver-xorg-video-all xserver-xorg-input-all xserver-xorg-core xinit x11-xserver-utils \
@@ -42,6 +46,7 @@ function installBrowser() {
4246 cp " ${SCRIPT_DIR} /.bash_profile" ~ /.bash_profile
4347}
4448
49+ sudo apt-get update
4550installService
4651installRemoteControl
4752installBrowser
0 commit comments