Issues with End of Line Sequences in bash scripts.

This commit is contained in:
Félix Aime 2020-11-26 09:03:24 +01:00
parent 32164277e3
commit 7cdd751600
2 changed files with 48 additions and 48 deletions

View File

@ -1,19 +1,19 @@
#!/bin/bash #!/bin/bash
# This small script is started by the service tinycheck-kiosk # This small script is started by the service tinycheck-kiosk
# in order to launch TinyCheck frontend in kiosk mode. # in order to launch TinyCheck frontend in kiosk mode.
xset s noblank xset s noblank
xset s off xset s off
xset -dpms xset -dpms
if grep 'hide_mouse: true' /usr/share/tinycheck/config.yaml; then if grep 'hide_mouse: true' /usr/share/tinycheck/config.yaml; then
unclutter -idle 0 & unclutter -idle 0 &
fi fi
if grep 'kiosk_mode: true' /usr/share/tinycheck/config.yaml; then 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/"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 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 & /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 fi

View File

@ -1,31 +1,31 @@
# Checking rights. # Checking rights.
if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 0 ]]; then
echo "The update must be run as root. Type in 'sudo bash $0' to run it as root." echo "The update must be run as root. Type in 'sudo bash $0' to run it as root."
exit 1 exit 1
fi fi
# Clone the current repo. # Clone the current repo.
echo "[+] Cloning the current repository to /tmp/" echo "[+] Cloning the current repository to /tmp/"
cd /tmp/ && git clone https://github.com/KasperskyLab/TinyCheck cd /tmp/ && git clone https://github.com/KasperskyLab/TinyCheck
# Deleteing the current folders. # Deleteing the current folders.
echo "[+] Deleting the current TinyCheck folders" echo "[+] Deleting the current TinyCheck folders"
rm -rf /usr/share/TinyCheck/app/ rm -rf /usr/share/TinyCheck/app/
rm -rf /usr/share/TinyCheck/server/ rm -rf /usr/share/TinyCheck/server/
rm -rf /usr/share/TinyCheck/analysis/ rm -rf /usr/share/TinyCheck/analysis/
# Copying the folders. # Copying the folders.
echo "[+] Copying the new version" echo "[+] Copying the new version"
cd /tmp/TinyCheck && cp -R app/ /usr/share/tinycheck/app/ 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 server/ /usr/share/tinycheck/server/
cd /tmp/TinyCheck && cp -R analysis/ /usr/share/tinycheck/analysis/ cd /tmp/TinyCheck && cp -R analysis/ /usr/share/tinycheck/analysis/
# Installing possible new dependencies. # Installing possible new dependencies.
echo "[+] Checking new Python dependencies" echo "[+] Checking new Python dependencies"
cd /tmp/TinyCheck && python3 -m pip install -r assets/requirements.txt cd /tmp/TinyCheck && python3 -m pip install -r assets/requirements.txt
# Back to the VueJS projects and reinstalling all the stuff # Back to the VueJS projects and reinstalling all the stuff
echo "[+] Building new interfaces..." echo "[+] Building new interfaces..."
cd /usr/share/TinyCheck/app/frontend/ && npm install && npm run build cd /usr/share/TinyCheck/app/frontend/ && npm install && npm run build
cd /usr/share/TinyCheck/app/backend/ && npm install && npm run build cd /usr/share/TinyCheck/app/backend/ && npm install && npm run build
echo "[+] TinyCheck updated!" echo "[+] TinyCheck updated!"