File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,13 @@ while IFS=: read -r filepath url; do
2525 request_id=$( curl -sS -H ' Accept: application/json' \
2626 " https://check-host.net/check-http?host=$url &max_nodes=1&node=us3.node.check-host.net" \
2727 | jq -r .request_id)
28- sleep 5
29- code=$( curl -sS -H ' Accept: application/json' \
30- " https://check-host.net/check-result/$request_id " \
31- | jq -r ' .[][0][3]' )
28+ for i in {1..3}; do
29+ code=$( curl -sS -H ' Accept: application/json' \
30+ " https://check-host.net/check-result/$request_id " \
31+ | jq -r -e ' .[][0][3]' ) || code=000
32+ sleep 3
33+ done
3234 fi
33- [[ " $code " =~ ^[0-9]+$ ]] || code=000
3435 if [ " $code " -ge 200 ] && [ " $code " -lt 400 ]; then
3536 printf " ${green} %s${reset} ${cyan} %s${reset} \n" " $code " " $url "
3637 else
You can’t perform that action at this time.
0 commit comments