Skip to content

Commit 1e8f497

Browse files
authored
Update check_urls.sh
1 parent 9ef203b commit 1e8f497

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

scripts/check_urls.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@ while IFS=: read -r filepath url; do
1717
printf '\n%s:\n' "$filepath"
1818
last_filepath=$filepath
1919
fi
20-
code=$(curl -gsLm30 --retry 3 --retry-delay 3 -o /dev/null -w "%{http_code}" -I "$url") || code=000
20+
code=$(curl -gsLm60 --retry 3 --retry-delay 3 --retry-connrefused -o /dev/null -w "%{http_code}" -I "$url") || code=000
2121
if [ "$code" -ge 400 ]; then
22-
code=$(curl -gsLm30 --retry 3 --retry-delay 3 -o /dev/null -w "%{http_code}" -r 0-0 -A "$user_agent" "$url") || code=000
22+
code=$(curl -gsLm60 --retry 3 --retry-delay 3 --retry-connrefused -o /dev/null -w "%{http_code}" -r 0-0 -A "$user_agent" "$url") || code=000
2323
fi
2424
if [ "$code" -lt 200 ] || [ "$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" \
25+
request_id=$(curl -sS -H 'Accept: application/json' "https://check-host.net/check-http?host=$url&max_nodes=1&node=us3.node.check-host.net" \
2726
| jq -r .request_id)
28-
for i in {1..3}; do
29-
code=$(curl -sS -H 'Accept: application/json' \
30-
"https://check-host.net/check-result/$request_id" \
27+
for _ in {1..3}; do
28+
code=$(curl -sS -H 'Accept: application/json' "https://check-host.net/check-result/$request_id" \
3129
| jq -r -e '.[][0][3]') || code=000
3230
sleep 3
3331
done

0 commit comments

Comments
 (0)