fnos: 修复飞牛链接失效

fixes #555
fixes #557
This commit is contained in:
bin456789 2026-02-12 22:27:20 +08:00
parent fc7bdc5711
commit ff4b6de258
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -1654,25 +1654,18 @@ Continue with DD?
fi
done
if [ "$basearch" = aarch64 ]; then
if [ -z "$iso" ]; then
IFS= read -r -p "ISO Link: " iso
if [ -z "$iso" ]; then
error_and_exit "ISO Link is empty."
fi
fi
else
iso=$(curl -L https://fnnas.com/ | grep -o -m1 'https://[^"]*\.iso')
# 对于同一行有多个成功匹配grep -m1 无效
iso=$(curl -L "https://fnnas.com/download$([ "$basearch" = aarch64 ] && echo -arm)" |
grep -o 'https://[^"]*\.iso' | head -1 | grep .)
# curl 7.82.0+
# curl -L --json '{"url":"'$iso'"}' https://www.fnnas.com/api/download-sign
# curl 7.82.0+
# curl -L --json '{"url":"'$iso'"}' https://www.fnnas.com/api/download-sign
iso=$(curl -L \
-d '{"url":"'$iso'"}' \
-H 'Content-Type: application/json' \
https://www.fnnas.com/api/download-sign |
grep -o 'https://[^"]*')
fi
iso=$(curl -L \
-d '{"url":"'$iso'"}' \
-H 'Content-Type: application/json' \
https://www.fnnas.com/api/download-sign |
grep -o 'https://[^"]*')
test_url "$iso" iso
eval "${step}_iso='$iso'"