File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 55# This source code is licensed under the BSD-style license found in the
66# LICENSE file in the root directory of this source tree.
77
8- set -x
9-
10- url=" https://www.cadence.com/en_US/home.html"
11- request_id=$( curl -sS -H ' Accept: application/json' \
12- " https://check-host.net/check-http?host=$url &max_nodes=1&node=us3.node.check-host.net" \
13- | jq -r .request_id)
14- curl -sS -H ' Accept: application/json' " https://check-host.net/check-result/$request_id "
15-
168set -euo pipefail
179
1810status=0
@@ -29,6 +21,15 @@ while IFS=: read -r filepath url; do
2921 if [ " $code " -ge 400 ]; then
3022 code=$( curl -gsLm30 -o /dev/null -w " %{http_code}" -r 0-0 -A " $user_agent " " $url " ) || code=000
3123 fi
24+ if [ " $code " -ge 400 ]; then
25+ request_id=$( curl -sS -H ' Accept: application/json' \
26+ " https://check-host.net/check-http?host=$url &max_nodes=1&node=us3.node.check-host.net" \
27+ | jq -r .request_id)
28+ code=$( curl -sS -H ' Accept: application/json' \
29+ " https://check-host.net/check-result/$request_id " \
30+ | jq -r ' ."us3.node.check-host.net"[0][3]' 2> /dev/null)
31+ fi
32+ [[ " $code " =~ ^[0-9]+$ ]] || code=000
3233 if [ " $code " -ge 200 ] && [ " $code " -lt 400 ]; then
3334 printf " ${green} %s${reset} ${cyan} %s${reset} \n" " $code " " $url "
3435 else
You can’t perform that action at this time.
0 commit comments