From ad230674c14bca0ae0a2e21f1d5bd9de3fda99a3 Mon Sep 17 00:00:00 2001 From: Molly Lau Date: Mon, 24 Apr 2023 23:57:25 +0900 Subject: [PATCH] Update InstallNET.sh --- Linux_reinstall/InstallNET.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Linux_reinstall/InstallNET.sh b/Linux_reinstall/InstallNET.sh index 064f193..cc1d999 100644 --- a/Linux_reinstall/InstallNET.sh +++ b/Linux_reinstall/InstallNET.sh @@ -1346,10 +1346,13 @@ fi [[ "$setNetbootXyz" == "1" ]] && SpikCheckDIST="1" if [[ "$SpikCheckDIST" == '0' ]]; then echo -e "\n\033[36m# Check DIST\033[0m" - DistsList="$(wget --no-check-certificate -qO- "$LinuxMirror/dists/" |grep -o 'href=.*/"' |cut -d'"' -f2 |sed '/-\|old\|Debian\|experimental\|stable\|test\|sid\|devel/d' |grep '^[^/]' |sed -n '1h;1!H;$g;s/\n//g;s/\//\;/g;$p')"; + DistsList="$(wget --no-check-certificate -qO- "$LinuxMirror/dists/" |grep -o 'href=.*/"' |cut -d'"' -f2 |sed '/-\|old\|Debian\|experimental\|stable\|test\|sid\|devel/d' |grep '^[^/]' |sed -n '1h;1!H;$g;s/\n//g;s/\//\;/g;$p')" for CheckDEB in `echo "$DistsList" |sed 's/;/\n/g'` do - [[ "$CheckDEB" == "$DIST" ]] && FindDists='1' && break; +# In some mirror, the value of parameter "DistsList" is "?C=N;O=Dbookworm;bullseye;buster;http:;;wisepoint.jp;product;wpshibb;" +# The second item in "DistsList" which is splited by ";" is O=Dbookworm. +# So we need to check whether "DIST" is approximately equal(contains) to "CheckDEB". + [[ "$CheckDEB" =~ "$DIST" ]] && FindDists='1' && break; done [[ "$FindDists" == '0' ]] && { echo -ne '\n\033[31mError! \033[0mThe dists version not found, Please check it! \n\n'