先用 axel 下载,出错再用 curl

This commit is contained in:
bin456789 2023-05-04 20:32:39 +08:00
parent d7494b20f2
commit cca7030daa
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -5,10 +5,19 @@ rescue --nomount
exec >/dev/pts/0 2>&1
download() {
if command -v axel; then
# axel 有问题
# axel "https://rocky-linux-us-south1.production.gcp.mirrors.ctrliq.cloud/pub/rocky//8.7/BaseOS/aarch64/os/images/pxeboot/vmlinuz"
# Initializing download: https://rocky-linux-us-south1.production.gcp.mirrors.ctrliq.cloud/pub/rocky//8.7/BaseOS/aarch64/os/images/pxeboot/vmlinuz
# Connection gone.
# axel https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.229-1/virtio-win-0.1.229.iso
# Initializing download: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.229-1/virtio-win-0.1.229.iso
# Too many redirects.
# 先用 axel 下载
[ -z $2 ] && save="" || save="-o $2"
axel $1 $save
else
if ! axel $1 $save; then
# 出错再用 curl
[ -z $2 ] && save="-O" || save="-o $2"
curl -L $1 $save
fi
@ -96,16 +105,7 @@ else
fi
# 安装 axel
# rpm -i --nodeps https://mirrors.aliyun.com/epel/7/$basearch/Packages/a/axel-2.4-9.el7.$basearch.rpm
# axel 有问题
# axel "https://rocky-linux-us-south1.production.gcp.mirrors.ctrliq.cloud/pub/rocky//8.7/BaseOS/aarch64/os/images/pxeboot/vmlinuz"
# Initializing download: https://rocky-linux-us-south1.production.gcp.mirrors.ctrliq.cloud/pub/rocky//8.7/BaseOS/aarch64/os/images/pxeboot/vmlinuz
# Connection gone.
# axel https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.229-1/virtio-win-0.1.229.iso
# Initializing download: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.229-1/virtio-win-0.1.229.iso
# Too many redirects.
rpm -i --nodeps https://mirrors.aliyun.com/epel/7/$basearch/Packages/a/axel-2.4-9.el7.$basearch.rpm
if [ -d /sys/firmware/efi ] && [ "$basearch" = "x86_64" ]; then
action='efi'