From 28a6fea331162ba613683e8578616f509d0acc11 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Wed, 1 Jan 2025 17:38:31 +0800 Subject: [PATCH] =?UTF-8?q?windows:=20=E5=85=BC=E5=AE=B9=20massgrave=20?= =?UTF-8?q?=E6=96=B0=20iso=20=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #225 --- reinstall.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/reinstall.sh b/reinstall.sh index c21dd2b..161b058 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -1316,7 +1316,27 @@ Continue? # 注意 windows server 2008 r2 serverdatacenter 不用改 image_name=${image_name/windows server 2008 server/windows longhorn server} - test_url "$iso" 'iso raw' + iso_filetype='iso raw' + iso_tested=false + + # 获取 massgrave.dev 直链 + if grep -Eiq '\.massgrave\.dev/.*\.(iso|img)' <<<"$iso"; then + # 如果已经是 iso 直链则跳过下面的 iso 测试 + if test_url_grace "$iso" "$iso_filetype"; then + iso_tested=true + else + msg="Could not find direct link for $iso" + if ! iso=$(grep -oE 'https?.*\.iso[^"]*' $tmp/img-test | sed 's/&/\&/g' | grep .); then + error_and_exit "$msg" + fi + fi + fi + + # 测试是否是 iso + if ! $iso_tested; then + test_url "$iso" "$iso_filetype" + fi + [ -n "$boot_wim" ] && test_url "$boot_wim" 'wim' # 判断 iso 架构是否兼容