42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
;;
esac
function downloadFile() {
local file urls
local downloadProgramArgs
local url
local finalURL
file="$1"
shift
urls=("$@")
finalURL="${urls[-1]}"
case "${downloadProgram}" in
curl)
downloadProgramArgs=(--header "X-Cache-URL: ${finalURL}" --location --insecure --fail --output "${file}")
;;
wget)
downloadProgramArgs=(--header="X-Cache-URL: ${finalURL}" --no-check-certificate --output-document="${file}")
;;
esac
for url in "${urls[@]}" __fail__; do
rm -f "${file}"
if [ "${url}" = '__fail__' ]; then
|
|
|
|
|
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
;;
esac
function downloadFile() {
local file urls
local downloadProgramArgs
local url
local authoritativeURL
file="$1"
shift
urls=("$@")
authoritativeURL="${urls[@]: -1}"
case "${downloadProgram}" in
curl)
downloadProgramArgs=(--header "X-Cache-URL: ${authoritativeURL}" --location --insecure --fail --output "${file}")
;;
wget)
downloadProgramArgs=(--header="X-Cache-URL: ${authoritativeURL}" --no-check-certificate --output-document="${file}")
;;
esac
for url in "${urls[@]}" __fail__; do
rm -f "${file}"
if [ "${url}" = '__fail__' ]; then
|