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() {
310310 local_file=$1
311311 source_url=$2
312312 header=$3
313+ local wget_output
314+ local code
313315 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 )
315317 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 )
317319 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)
318326 if [ " $code " != " 200" ]; then
319327 log_err " http_download_wget received HTTP status $code "
320328 return 1
You can’t perform that action at this time.
0 commit comments