From a07f3d7e5d4d89b0f303bbb6753344f71cb98116 Mon Sep 17 00:00:00 2001 From: Colin Kuebler Date: Wed, 29 Jan 2020 11:57:49 -0500 Subject: [PATCH] Add timeout on backup and allow user to continue anyway, fix #437 --- start_flash.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/start_flash.sh b/start_flash.sh index e889e4c..bbed451 100755 --- a/start_flash.sh +++ b/start_flash.sh @@ -94,7 +94,14 @@ while true; do backupfolder="../backups/$timestamp" mkdir -p "$backupfolder" pushd "$backupfolder" >/dev/null || exit - curl -JO http://10.42.42.42/backup + + if ! curl -JOm 90 http://10.42.42.42/backup; then + echo "Could not fetch a complete backup" + read -p "Do you want to continue anyway? [y/N] " -n 1 -r + echo + [[ "$REPLY" =~ ^[Yy]$ ]] || break + sleep 2 + fi echo "======================================================" echo "Getting Info from IoT-device"