From 07b52fc2fbf26d0e7304926586c71ef602cfeb33 Mon Sep 17 00:00:00 2001 From: Tobias Hopp Date: Mon, 13 Feb 2023 11:30:26 +0100 Subject: [PATCH] Update updater --- update.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/update.sh b/update.sh index e86ec1a..e2af63b 100755 --- a/update.sh +++ b/update.sh @@ -1,11 +1,16 @@ #!/bin/bash cd /home/itender/itender || exit -1 -git pull "https://tobiash:!IwedwrimmVeudiweN!@git.gaminggeneration.de/tobiash/itender.git" --quiet -yarn -yarn run compile -cd ./arduino/itender/ -arduino-cli compile --fqbn arduino:avr:mega itender.ino || true -sudo systemctl stop itender -timeout 30 arduino-cli upload --port /dev/ttyACM0 --fqbn arduino:avr:mega itender.ino || true -sudo systemctl start itender + +if [ -z "$1" ] +then + git pull "https://tobiash:!IwedwrimmVeudiweN!@git.gaminggeneration.de/tobiash/itender.git" --quiet +else + yarn + yarn run compile + cd ./arduino/itender/ + arduino-cli compile --fqbn arduino:avr:mega itender.ino || true + sudo systemctl stop itender + timeout 40 arduino-cli upload --port /dev/ttyACM0 --fqbn arduino:avr:mega itender.ino || true + sudo systemctl start itender +fi exit 0