|
1 # This Source Code Form is subject to the terms of the Mozilla Public |
|
2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
4 |
|
5 download_builds() { |
|
6 # cleanup |
|
7 mkdir -p downloads/ |
|
8 rm -rf downloads/* |
|
9 |
|
10 source_url="$1" |
|
11 target_url="$2" |
|
12 |
|
13 if [ -z "$source_url" ] || [ -z "$target_url" ] |
|
14 then |
|
15 "download_builds usage: <source_url> <target_url>" |
|
16 exit 1 |
|
17 fi |
|
18 |
|
19 for url in "$source_url" "$target_url" |
|
20 do |
|
21 source_file=`basename "$url"` |
|
22 if [ -f "$source_file" ]; then rm "$source_file"; fi |
|
23 #PARAMS="--user=user --password=pass" |
|
24 cd downloads |
|
25 if [ -f "$source_file" ]; then rm "$source_file"; fi |
|
26 wget --no-check-certificate -nv $PARAMS "$url" 2>&1 |
|
27 if [ $? != 0 ]; then |
|
28 echo "FAIL: Could not download source $source_file from $url" |
|
29 echo "skipping.." |
|
30 cd ../ |
|
31 continue |
|
32 fi |
|
33 cd ../ |
|
34 done |
|
35 } |