mirror of
https://github.com/dockur/windows.git
synced 2025-10-28 11:45:50 +00:00
feat: Add additional download mirrors
This commit is contained in:
parent
93ef400c67
commit
8f84b56512
1 changed files with 42 additions and 2 deletions
|
|
@ -483,18 +483,18 @@ downloadImage() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$VERSION" != "win10x64"* ]] && [[ "$VERSION" != "win11x64" ]]; then
|
if [[ "$VERSION" != "win10x64" ]] && [[ "$VERSION" != "win11x64" ]]; then
|
||||||
error "Failed to download $desc" && return 1
|
error "Failed to download $desc" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
info "Failed to download $desc using Mido, will try a different method now..."
|
info "Failed to download $desc using Mido, will try a different method now..."
|
||||||
|
|
||||||
|
rm -f "$iso"
|
||||||
rm -rf "$TMP"
|
rm -rf "$TMP"
|
||||||
mkdir -p "$TMP"
|
mkdir -p "$TMP"
|
||||||
|
|
||||||
ISO="$TMP/$VERSION.esd"
|
ISO="$TMP/$VERSION.esd"
|
||||||
iso="$ISO"
|
iso="$ISO"
|
||||||
file="$ISO"
|
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
|
|
||||||
if ! getESD "$TMP/esd" "$iso"; then
|
if ! getESD "$TMP/esd" "$iso"; then
|
||||||
|
|
@ -526,6 +526,46 @@ downloadImage() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$EXTERNAL" != [Yy1]* ]]; then
|
||||||
|
|
||||||
|
case "${VERSION,,}" in
|
||||||
|
"win11${ARCH,,}")
|
||||||
|
url="https://dl.bobpony.com/windows/11/en-us_windows_11_23h2_x64.iso"
|
||||||
|
;;
|
||||||
|
"win10${ARCH,,}")
|
||||||
|
url="https://dl.bobpony.com/windows/10/en-us_windows_10_22h2_x64.iso"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
error "Failed to download $url" && return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
info "Failed to download $desc from Microsoft, will try a different method now..."
|
||||||
|
|
||||||
|
rm -f "$iso"
|
||||||
|
rm -rf "$TMP"
|
||||||
|
mkdir -p "$TMP"
|
||||||
|
|
||||||
|
ISO="$TMP/$BASE"
|
||||||
|
iso="$ISO"
|
||||||
|
rm -f "$iso"
|
||||||
|
|
||||||
|
msg="Downloading $desc..."
|
||||||
|
info "$msg" && html "$msg"
|
||||||
|
/run/progress.sh "$iso" "Downloading $desc ([P])..." &
|
||||||
|
|
||||||
|
{ wget "$url" -O "$iso" -q --no-check-certificate --show-progress "$progress"; rc=$?; } || :
|
||||||
|
|
||||||
|
fKill "progress.sh"
|
||||||
|
(( rc != 0 )) && error "Failed to download $url , reason: $rc" && return 1
|
||||||
|
|
||||||
|
if [ -f "$iso" ]; then
|
||||||
|
if [ $(stat -c%s "$iso") -gt 100000000 ]; then
|
||||||
|
html "Download finished successfully..." && return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
error "Failed to download $url" && return 1
|
error "Failed to download $url" && return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue