summaryrefslogtreecommitdiffstats
path: root/bash/tools/creating_data/download-http-files.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bash/tools/creating_data/download-http-files.sh')
-rw-r--r--bash/tools/creating_data/download-http-files.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/bash/tools/creating_data/download-http-files.sh b/bash/tools/creating_data/download-http-files.sh
index 267d7952..06f41354 100644
--- a/bash/tools/creating_data/download-http-files.sh
+++ b/bash/tools/creating_data/download-http-files.sh
@@ -15,20 +15,25 @@
# limitations under the License.
#
# COPYRIGHT NOTICE ENDS HERE
+
LIST_FILE="$1"
if [[ -z "$LIST_FILE" ]]; then
echo "Missing list file"
exit 1
fi
+
outdir="$2"
if [[ -z "$outdir" ]]; then
echo "Missing output directory"
exit 1
fi
+
lines=$(cat "$LIST_FILE" | wc -l)
cnt=1
+
# create output dir if not exists
mkdir -p "$outdir"
+
while read -r line; do
# www.springframework.org/schema/tool/spring-tool-4.3.xsd
file="${line%%\?*}"
@@ -39,4 +44,5 @@ while read -r line; do
# drop below 10b/10s
curl --retry 5 -y 10 -Y 10 --location "$line" -o "$outdir/$file" &>/dev/null
cnt=$((cnt+1))
-done < "$LIST_FILE" \ No newline at end of file
+
+done < "$LIST_FILE"