恢复通过某些 bash 脚本的 curl 下载

Resuming curl download that goes through some bash script

我正在尝试通过 curl 下载一个巨大的文件。据我所知,有一些 bash 脚本挂在它们之间以传递正确的文件(在这种情况下是运行 IE10 的虚拟机):

curl -s https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS=10 bash

由于不稳定的互联网连接,下载不断失败,所以我需要一种方法来在当前位置恢复下载。我试过像这样恢复下载:

curl -s -C - https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS=10 bash

但是,我得到的只是一些 MD5 检查失败的错误...我是否遗漏了什么?

您运行那里的 curl 命令不会下载 VM 映像。它 downloads a bash script called ievms.sh 然后将脚本通过管道传输到 bash,后者执行它。

查看脚本,它为 IE10 下载的文件似乎在这里:

http://virtualization.modern.ie/vhd/IEKitV1_Final/VirtualBox/OSX/IE10_Win8.zip

我认为如果您下载该文件(您可以使用浏览器或 curl)并将其放入 ~/.ievms,然后再次 运行 命令,应该会看到该文件已经已下载并完成安装。

如果部分下载的文件已经存在,那么您可以使用以下命令继续下载:

curl -L "http://virtualization.modern.ie/vhd/IEKitV1_Final/VirtualBox/OSX/IE10_Win8.zip" \
  -C - -o ~/.ievms/IE10_Win8.zip

(然后运行原来的IEVMs curl命令完成安装。)