mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-31 19:08:07 +08:00
core: 备用下载方法改为 wget
This commit is contained in:
parent
1f12589f47
commit
c3c7142df7
10
trans.sh
10
trans.sh
@ -66,10 +66,14 @@ download() {
|
||||
fi
|
||||
fi
|
||||
# 先用 aria2 下载
|
||||
# aria2 下载 fedora 官方镜像链接会将meta4文件下载下来,而且占用了指定文件名,造成重命名失效。而且无法指定目录
|
||||
# https://download.opensuse.org/distribution/leap/15.5/appliances/openSUSE-Leap-15.5-Minimal-VM.x86_64-kvm-and-xen.qcow2
|
||||
# https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-o
|
||||
if ! (command -v aria2c && aria2c -x4 --allow-overwrite=true $url $save); then
|
||||
# 出错再用 curl
|
||||
[ -z $file ] && save="-O" || save="-o $file"
|
||||
curl -L $url $save
|
||||
# 出错再用 wget
|
||||
# alpine 的 busybox 没有 curl
|
||||
[ -z $file ] && save="" || save="-O $file"
|
||||
wget $url $save
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user