File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -310,11 +310,19 @@ http_download_wget() {
310
310
local_file=$1
311
311
source_url=$2
312
312
header=$3
313
+ local wget_output
314
+ local code
313
315
if [ -z " $header " ]; then
314
- code =$( wget --server-response --quiet -O " $local_file " " $source_url " 2>&1 | awk ' /^ HTTP/{print $2} ' | tail -n1 )
316
+ wget_output =$( wget --server-response --quiet -O " $local_file " " $source_url " 2>&1 )
315
317
else
316
- code =$( wget --server-response --quiet --header " $header " -O " $local_file " " $source_url " 2>&1 | awk ' /^ HTTP/{print $2} ' | tail -n1 )
318
+ wget_output =$( wget --server-response --quiet --header " $header " -O " $local_file " " $source_url " 2>&1 )
317
319
fi
320
+ local wget_exit=$?
321
+ if [ $wget_exit -ne 0 ]; then
322
+ log_err " http_download_wget failed: wget exited with status $wget_exit "
323
+ return 1
324
+ fi
325
+ code=$( echo " $wget_output " | awk ' /^ HTTP/{print $2}' | tail -n1)
318
326
if [ " $code " != " 200" ]; then
319
327
log_err " http_download_wget received HTTP status $code "
320
328
return 1
You can’t perform that action at this time.
0 commit comments