Update InstallNET.sh

This commit is contained in:
Molly Lau 2023-04-24 23:57:25 +09:00 committed by GitHub
parent 53d455b413
commit ad230674c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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'