From 4adc9deca54f365692590a855e11ff663601ee7c Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 17 Apr 2023 14:30:32 +0200 Subject: [PATCH] Updates --- agent/agent.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/agent/agent.sh b/agent/agent.sh index 20e295c..43f3d6d 100644 --- a/agent/agent.sh +++ b/agent/agent.sh @@ -67,13 +67,19 @@ else rm -f /tmp/agent.sh - if curl -s -k -m 5 -o /tmp/agent.sh https://raw.githubusercontent.com/kroese/virtual-dsm/master/agent/agent.sh; then - if [ -f /tmp/agent.sh ]; then + if curl -s -f -k -m 5 -o /tmp/agent.sh https://raw.githubusercontent.com/kroese/virtual-dsm/master/agent/agent.sh; then + if [ -f "/tmp/agent.sh" ]; then line=$(read -r FIRSTLINE < /tmp/agent.sh) if [ "$line" == "#!/usr/bin/env bash" ]; then echo "Update found.." > /dev/ttyS0 + else + echo "Update error 1.. $line" > /dev/ttyS0 fi + else + echo "Update error 2.." > /dev/ttyS0 fi + else + echo "Update error 3.. $?" > /dev/ttyS0 fi sleep 5