From 7cdd751600a91203930a22dff8748247cef07614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Aime?= Date: Thu, 26 Nov 2020 09:03:24 +0100 Subject: [PATCH] Issues with End of Line Sequences in bash scripts. --- kiosk.sh | 36 ++++++++++++++++----------------- update.sh | 60 +++++++++++++++++++++++++++---------------------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/kiosk.sh b/kiosk.sh index 6aae631..1fd23ee 100644 --- a/kiosk.sh +++ b/kiosk.sh @@ -1,19 +1,19 @@ -#!/bin/bash - -# This small script is started by the service tinycheck-kiosk -# in order to launch TinyCheck frontend in kiosk mode. - -xset s noblank -xset s off -xset -dpms - -if grep 'hide_mouse: true' /usr/share/tinycheck/config.yaml; then - unclutter -idle 0 & -fi - -if grep 'kiosk_mode: true' /usr/share/tinycheck/config.yaml; then - sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences - sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences - - /usr/bin/chromium-browser http://127.0.0.1 --start-fullscreen --kiosk --incognito --noerrdialogs --disable-translate --no-first-run --fast --fast-start --disable-infobars --disable-features=TranslateUI & +#!/bin/bash + +# This small script is started by the service tinycheck-kiosk +# in order to launch TinyCheck frontend in kiosk mode. + +xset s noblank +xset s off +xset -dpms + +if grep 'hide_mouse: true' /usr/share/tinycheck/config.yaml; then + unclutter -idle 0 & +fi + +if grep 'kiosk_mode: true' /usr/share/tinycheck/config.yaml; then + sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences + sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences + + /usr/bin/chromium-browser http://127.0.0.1 --start-fullscreen --kiosk --incognito --noerrdialogs --disable-translate --no-first-run --fast --fast-start --disable-infobars --disable-features=TranslateUI & fi \ No newline at end of file diff --git a/update.sh b/update.sh index a69339d..7958787 100644 --- a/update.sh +++ b/update.sh @@ -1,31 +1,31 @@ -# Checking rights. -if [[ $EUID -ne 0 ]]; then - echo "The update must be run as root. Type in 'sudo bash $0' to run it as root." - exit 1 -fi - -# Clone the current repo. -echo "[+] Cloning the current repository to /tmp/" -cd /tmp/ && git clone https://github.com/KasperskyLab/TinyCheck - -# Deleteing the current folders. -echo "[+] Deleting the current TinyCheck folders" -rm -rf /usr/share/TinyCheck/app/ -rm -rf /usr/share/TinyCheck/server/ -rm -rf /usr/share/TinyCheck/analysis/ - -# Copying the folders. -echo "[+] Copying the new version" -cd /tmp/TinyCheck && cp -R app/ /usr/share/tinycheck/app/ -cd /tmp/TinyCheck && cp -R server/ /usr/share/tinycheck/server/ -cd /tmp/TinyCheck && cp -R analysis/ /usr/share/tinycheck/analysis/ - -# Installing possible new dependencies. -echo "[+] Checking new Python dependencies" -cd /tmp/TinyCheck && python3 -m pip install -r assets/requirements.txt - -# Back to the VueJS projects and reinstalling all the stuff -echo "[+] Building new interfaces..." -cd /usr/share/TinyCheck/app/frontend/ && npm install && npm run build -cd /usr/share/TinyCheck/app/backend/ && npm install && npm run build +# Checking rights. +if [[ $EUID -ne 0 ]]; then + echo "The update must be run as root. Type in 'sudo bash $0' to run it as root." + exit 1 +fi + +# Clone the current repo. +echo "[+] Cloning the current repository to /tmp/" +cd /tmp/ && git clone https://github.com/KasperskyLab/TinyCheck + +# Deleteing the current folders. +echo "[+] Deleting the current TinyCheck folders" +rm -rf /usr/share/TinyCheck/app/ +rm -rf /usr/share/TinyCheck/server/ +rm -rf /usr/share/TinyCheck/analysis/ + +# Copying the folders. +echo "[+] Copying the new version" +cd /tmp/TinyCheck && cp -R app/ /usr/share/tinycheck/app/ +cd /tmp/TinyCheck && cp -R server/ /usr/share/tinycheck/server/ +cd /tmp/TinyCheck && cp -R analysis/ /usr/share/tinycheck/analysis/ + +# Installing possible new dependencies. +echo "[+] Checking new Python dependencies" +cd /tmp/TinyCheck && python3 -m pip install -r assets/requirements.txt + +# Back to the VueJS projects and reinstalling all the stuff +echo "[+] Building new interfaces..." +cd /usr/share/TinyCheck/app/frontend/ && npm install && npm run build +cd /usr/share/TinyCheck/app/backend/ && npm install && npm run build echo "[+] TinyCheck updated!" \ No newline at end of file