-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenwrt-http-check.sh
More file actions
executable file
·154 lines (126 loc) · 5.49 KB
/
openwrt-http-check.sh
File metadata and controls
executable file
·154 lines (126 loc) · 5.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/usr/bin/env bash
#检查OpenWrt由于 AdGuardHome等广告过滤插件带来的问题(表现:通常对HTTPS无影响,但会阻断http连接)
[ -f /v/bin/aliaswinapp ] && source /v/bin/aliaswinapp
[ -z "$(type -t print_color)" ] && print_color() {
[ $# -gt 1 ] && shift
echo -e "$*"
}
#curl() {
# #统计设置UserAgent
# \\curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -v "$@"
#}
successCount=0
failureCount=0
echo -e "\n检查网易163HTTP..."
url="http://www.163.com/"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
echo -e "\n检查网易图片资源HTTP..."
url="http://cms-bucket.ws.126.net/2022/1204/24deb860p00rmcdi7000nc000s600e3c.png?imageView&thumbnail=185y116&quality=100&quality=100"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
echo -e "\n检查搜狐门户HTTP..."
url="http://www.sohu.com/"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
echo -e "\n检查搜狐博客HTTP..."
url="http://r1.suc.itc.cn/"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
echo -e "\n检查搜狐博客图片资源HTTP..."
url="http://i2.itc.cn/20170621/a75_59713a26_c0d6_13c5_3afb_4e12bda9f752_1.jpg"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
echo -e "\n检查搜狐视频栏目页HTTP..."
url="http://tv.sohu.com/s2019/dashjs2019/"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
echo -e "\n检查新浪体育HTTP..."
url="http://sports.sina.com.cn/"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
echo -e "\n检查新浪帮助图片资源HTTP..."
## 浏览器查看:http://help.sina.com.cn/
url="http://n.sinaimg.cn/customer/260/w1280h580/20200901/cccf-iypetiv2384303.png"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
echo -e "\n检查爱奇艺首页HTTP..."
url="http://www.iqiyi.com/"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
echo -e "\n检查爱奇艺在线客服HTTP..."
url="http://cserver.iqiyi.com/index?e=1"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
echo -e "\n检查爱奇艺登录HTTP..."
url="http://www.iqiyi.com/iframe/loginreg?show_back=1&redirect_url=https%3A%2F%2Fcserver.iqiyi.com%2Fchat.html%3Fentry%3Dpc-zh%26e%3D1&__PHP=1&from_url=https%3A%2F%2Fcserver.iqiyi.com%2Fchat.html%3Fentry%3Dpc-zh%26e%3D1"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
echo -e "\n检查百度贴吧HTTP..."
url="http://tieba.baidu.com/p/8170405143?frwh=index"
echo "test URL:$url"
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36" -sSI --connect-timeout 3 "$url"
[ $? -eq 0 ] && {
print_color "33" "OK!" && let successCount+=1
} || {
print_color 9 "Failure..." && let failureCount+=1
}
print_color 40 "成功次数:"
echo "$successCount"
print_color 40 "失败次数:"
echo "$failureCount"