Skip to content

Commit f1a1e17

Browse files
authored
test
1 parent 7ca4731 commit f1a1e17

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

scripts/check_urls.sh

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,51 @@
77

88
set -x
99

10-
ua='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36'
11-
accept_hdr='text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
12-
url='https://wiki.mozilla.org/Abstract_Interpretation'
10+
ua="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
11+
accept_hdr="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
12+
lang_hdr="en-US,en;q=0.9"
13+
enc_hdr="gzip, deflate, br"
14+
cache_hdr="no-cache"
15+
conn_hdr="keep-alive"
1316

14-
curl -s -o /dev/null -w '%{http_code}\n' -L "$url"
17+
url="https://wiki.mozilla.org/Abstract_Interpretation"
1518

16-
curl -s -o /dev/null -w '%{http_code}\n' -L -A "$ua" "$url"
19+
curl -s -o /dev/null -w '%{http_code}\n' \
20+
-I \
21+
-A "$ua" \
22+
-H "Accept: $accept_hdr" \
23+
-H "Accept-Language: $lang_hdr" \
24+
-H "Accept-Encoding: $enc_hdr" \
25+
-H "Connection: $conn_hdr" \
26+
-H "Cache-Control: $cache_hdr" \
27+
"$url"
1728

18-
curl -s -o /dev/null -w '%{http_code}\n' -L -A "$ua" -H "Accept: $accept_hdr" "$url"
29+
curl -s -o /dev/null -w '%{http_code}\n' \
30+
--range 0-0 \
31+
-A "$ua" \
32+
-H "Accept: $accept_hdr" \
33+
-H "Accept-Language: $lang_hdr" \
34+
-H "Accept-Encoding: $enc_hdr" \
35+
-H "Connection: $conn_hdr" \
36+
-H "Cache-Control: $cache_hdr" \
37+
"$url"
1938

20-
curl -s -o /dev/null -w '%{http_code}\n' -L -A "$ua" -H "Referer: https://$(echo $url | awk -F/ '{print $3}')/" "$url"
39+
wget --spider --server-response --user-agent="$ua" "$url" 2>&1 \
40+
| awk '/^ HTTP\// { print $2 }'
2141

22-
curl -4 -s -o /dev/null -w '%{http_code}\n' -L -A "$ua" "$url"
42+
wget --spider --server-response --user-agent="$ua" --method=GET "$url" 2>&1 \
43+
| awk '/^ HTTP\// { print $2 }'
44+
45+
curl -s -o /dev/null -w '%{http_code}\n' \
46+
--http1.1 \
47+
-I \
48+
-A "$ua" \
49+
-H "Accept: $accept_hdr" \
50+
-H "Accept-Language: $lang_hdr" \
51+
-H "Accept-Encoding: $enc_hdr" \
52+
-H "Connection: $conn_hdr" \
53+
-H "Cache-Control: $cache_hdr" \
54+
"$url"
2355

2456
set -euo pipefail
2557

0 commit comments

Comments
 (0)