From 5b768ba4636a994aa93b6ea9bb1a764c563546bf Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 1 May 2024 05:29:51 +0200 Subject: [PATCH] Update install.sh --- src/install.sh | 57 ++++++++++---------------------------------------- 1 file changed, 11 insertions(+), 46 deletions(-) diff --git a/src/install.sh b/src/install.sh index e4addfc..af05d65 100644 --- a/src/install.sh +++ b/src/install.sh @@ -372,55 +372,20 @@ downloadImage() { fi - url=$(getLink "$version") + for i in {1..9} + do - if [ -n "$url" ]; then - if [[ "$tried" != "n" ]]; then - info "Failed to download $desc from Microsoft, will try another mirror now..." + url=$(getLink "$i" "$version") + + if [ -n "$url" ]; then + if [[ "$tried" != "n" ]]; then + info "Failed to download $desc, will try another mirror now..." + fi + tried="y" + downloadFile "$iso" "$url" "$desc" && return 0 fi - tried="y" - downloadFile "$iso" "$url" "$desc" && return 0 - fi - url=$(getLink2 "$version") - - if [ -n "$url" ]; then - if [[ "$tried" != "n" ]]; then - info "Failed to download $desc, will try another mirror now..." - fi - tried="y" - downloadFile "$iso" "$url" "$desc" && return 0 - fi - - url=$(getLink3 "$version") - - if [ -n "$url" ]; then - if [[ "$tried" != "n" ]]; then - info "Failed to download $desc, will try another mirror now..." - fi - tried="y" - downloadFile "$iso" "$url" "$desc" && return 0 - fi - - url=$(getLink4 "$version") - - if [ -n "$url" ]; then - if [[ "$tried" != "n" ]]; then - info "Failed to download $desc, will try another mirror now..." - fi - tried="y" - downloadFile "$iso" "$url" "$desc" && return 0 - fi - - url=$(getLink5 "$version") - - if [ -n "$url" ]; then - if [[ "$tried" != "n" ]]; then - info "Failed to download $desc, will try another mirror now..." - fi - tried="y" - downloadFile "$iso" "$url" "$desc" && return 0 - fi + done return 1 }