File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -29,12 +29,15 @@ probe_url() {
2929 --show-error \
3030 --fail \
3131 --location \
32+ --insecure \
33+ --max-time 30 \
3234 --output /dev/null \
3335 --write-out " %{http_code}" \
3436 " ${URL} "
35- )
36- if [[ " ${?} " -ne 0 ]]; then
37- echo " # ERROR: Failed to fetch URL '${URL} '."
37+ ) || curl_exit=${?}
38+
39+ if [[ " ${curl_exit:- 0} " -ne 0 ]]; then
40+ echo " # ERROR: Failed to fetch URL '${URL} ', returned '${curl_exit} '." >&2
3841 return 1
3942 fi
4043
@@ -43,7 +46,7 @@ probe_url() {
4346 return 0
4447 else
4548 echo " # ERROR: '${URL} ' returned status code '${response_code} '" \
46- " expected ${STATUS_CODE} ."
49+ " expected ${STATUS_CODE} ." >&2
4750 return 1
4851 fi
4952}
@@ -81,6 +84,6 @@ if test_url; then
8184 exit 0
8285else
8386 echo " # ERROR: URL '${URL} ' is not accessible or returned an" \
84- " unexpected status code."
87+ " unexpected status code." >&2
8588 exit 1
8689fi
You can’t perform that action at this time.
0 commit comments