Compare commits

...

321 Commits
v1.0.2 ... main

Author SHA1 Message Date
NodeLoc.com
4ef2cffbe2
Merge pull request #2 from nodeloc/main
优化代码,支持短代码。
2025-01-23 11:42:46 +08:00
James
3bed8f5f7f update 2025-01-21 12:59:01 +08:00
James
af8ed99ba4 交互隐藏 2025-01-21 12:56:52 +08:00
James
3e19b74497 取消互动信息 2025-01-21 12:52:36 +08:00
James
2f3dc9ef79 version 1.0 2025-01-21 12:46:26 +08:00
James
2199b3fe67 change to ghfast.top 2025-01-21 12:36:17 +08:00
James
a33fa6578e Change to autotrace 2025-01-21 12:35:30 +08:00
James
f70be8a35c finish 2025-01-21 12:20:03 +08:00
James
51d408c112 tty 2 2025-01-21 11:57:18 +08:00
James
a1aa7daa99 run_selected_scripts 2025-01-21 11:10:57 +08:00
James
db71552652 优化脚本 2025-01-21 10:58:55 +08:00
James
b253805e1a tty add 2025-01-21 02:26:10 +08:00
James
b8b242a1c3 tty 2025-01-21 01:45:18 +08:00
James
733c5ef5bb update bench 2025-01-21 01:42:12 +08:00
Jensfrank
31a51673e6
Update version.sh 2024-09-22 00:03:59 +08:00
Jensfrank
a1a95c4dc7
Update Nlbench.sh 2024-09-22 00:03:31 +08:00
Jensfrank
e6224fd115
Update Nlbench.sh 2024-09-22 00:01:18 +08:00
Jensfrank
ca784f8316
Update Nlbench.sh 2024-09-21 23:57:26 +08:00
Jensfrank
e81ccd304a
Update Nlbench.sh 2024-09-21 23:49:45 +08:00
Jensfrank
386aa724a3
Update version.sh 2024-09-21 23:25:56 +08:00
Jensfrank
f305bf59c5
Update Nlbench.sh 2024-09-21 23:25:33 +08:00
Jensfrank
23af25e6cb
Update README.md 2024-09-21 22:32:24 +08:00
Jensfrank
7c4b8cf06d
Update README.md 2024-09-21 22:28:05 +08:00
Jensfrank
7d7e94a3ed
Update README.md 2024-09-21 20:14:09 +08:00
Jensfrank
4b30567b4e
Update README.md 2024-09-21 19:14:39 +08:00
Jensfrank
7fd57ae6e5
Delete Nlbench_pro.sh 2024-09-09 22:35:08 +08:00
Jensfrank
0a8da4d642
Delete Nlbench_beta.sh 2024-09-09 22:34:57 +08:00
Jensfrank
b3f937e48e
Update README.md 2024-09-09 13:35:57 +08:00
Jensfrank
85d7ab4594
更新版本号 2024-09-09 13:35:10 +08:00
Jensfrank
863af11630
Update version.sh 2024-09-09 13:34:27 +08:00
xypp
0d8268ecf1 兼容新的系统接口 2024-09-09 02:12:53 +08:00
Jensfrank
0b770cf2cd
Update README.md 2024-09-08 12:23:23 +08:00
Jensfrank
3cec8b14f9
Update Nlbench.sh 2024-09-07 23:09:58 +08:00
Jensfrank
735b635490
Update Nlbench.sh 2024-09-07 23:03:37 +08:00
Jensfrank
c5732df15a
Update Nlbench.sh 2024-09-07 22:58:02 +08:00
Jensfrank
90b2807070
Update Nlbench.sh 2024-09-07 22:57:26 +08:00
Jensfrank
2fcff740b5
Update Nlbench.sh 2024-09-07 22:54:12 +08:00
Jensfrank
fb3b27a67a
Update Nlbench.sh 2024-09-07 22:53:26 +08:00
Jensfrank
2da6546e4d
Update Nlbench.sh 2024-09-07 22:47:28 +08:00
Jensfrank
6f41c63ba4
Update Nlbench.sh 2024-09-07 22:42:09 +08:00
Jensfrank
8eeda69163
Update Nlbench.sh 2024-09-07 22:40:08 +08:00
Jensfrank
688c07899d
Update Nlbench.sh 2024-09-07 21:58:58 +08:00
Jensfrank
514909f411
Update version.sh 2024-09-07 19:15:37 +08:00
Jensfrank
7b4120350c
Update Nlbench.sh 2024-09-07 19:15:11 +08:00
Jensfrank
6911d821db
Update version.sh 2024-09-07 18:47:30 +08:00
Jensfrank
98c7c4abf4
Update Nlbench.sh 2024-09-07 18:47:19 +08:00
Jensfrank
ea01c5d727
Update version.sh 2024-09-07 18:40:59 +08:00
Jensfrank
0b7ae16285
Update Nlbench.sh 2024-09-07 18:40:45 +08:00
Jensfrank
169c63e49b
Update Nlbench.sh 2024-09-07 18:34:42 +08:00
Jensfrank
3095f30989
Update Nlbench.sh 2024-09-07 18:07:31 +08:00
Jensfrank
12b15e12d7
Update Nlbench.sh 2024-09-07 15:04:54 +08:00
Jensfrank
cd5677ae71
Update Nlbench.sh 2024-09-07 14:47:29 +08:00
Jensfrank
b60766e8f1
Update version.sh 2024-09-07 13:57:50 +08:00
Jensfrank
e0537f57e6
Update Nlbench.sh 2024-09-07 13:57:23 +08:00
Jensfrank
ddcfd53aef
Update Nlbench.sh 2024-08-28 16:14:25 +08:00
Jensfrank
bfbbbf36e2
Update version.sh 2024-08-28 16:11:08 +08:00
Jensfrank
48ade6daf1
Update Nlbench.sh 2024-08-28 16:10:51 +08:00
Jensfrank
c6babfd3e6
Delete nodeloc_vps_autotest_yabs.sh 2024-08-19 16:32:06 +08:00
Jensfrank
edd2b3d091
Delete nodeloc_vps_autotest_trace.sh 2024-08-19 16:31:58 +08:00
Jensfrank
6eefbd1240
Delete nodeloc_vps_autotest_speed.sh 2024-08-19 16:31:16 +08:00
Jensfrank
7e888989b6
Delete nodeloc_vps_autotest_response.sh 2024-08-19 16:31:08 +08:00
Jensfrank
77b5a56949
Delete nodeloc_vps_autotest_media.sh 2024-08-19 16:30:59 +08:00
Jensfrank
ae1691cb7a
Delete nodeloc_vps_autotest_ip.sh 2024-08-19 16:30:51 +08:00
Jensfrank
13c8f3c215
Delete nodeloc_vps_autotest_fusion.sh 2024-08-19 16:30:38 +08:00
Jensfrank
c51dd8b551
Update README.md 2024-08-19 15:50:18 +08:00
Jensfrank
820c94b27f
Update version.sh 2024-08-19 15:50:01 +08:00
Jensfrank
292a642821
Update Nlbench.sh 2024-08-19 15:49:27 +08:00
Jensfrank
b11b633b23
Update Nlbench.sh 2024-08-19 15:48:51 +08:00
Jensfrank
c3686314ee
Update Nlbench_beta.sh 2024-08-19 15:46:08 +08:00
Jensfrank
a2b20295a5
Update Nlbench.sh 2024-08-13 17:19:22 +08:00
Jensfrank
11e2e11ada
Update Nlbench.sh 2024-08-13 16:47:54 +08:00
Jensfrank
b818c7f649
Update README.md 2024-08-13 16:36:33 +08:00
Jensfrank
24f1dbce6d
Update Nlbench.sh 2024-08-13 16:35:57 +08:00
丰仔
616ed2bf1c
Update README.md 2024-08-13 15:48:40 +08:00
Jensfrank
31ca394378
Update Nlbench_beta.sh 2024-08-13 15:35:15 +08:00
Jensfrank
ebf7e3df30
Update Nlbench_beta.sh 2024-08-13 15:32:19 +08:00
Jensfrank
6dfa75f038
Update Nlbench.sh 2024-08-13 15:13:44 +08:00
Jensfrank
c2fac4dbab
Update version.sh 2024-08-13 15:05:21 +08:00
Jensfrank
8cae62c634
Update Nlbench.sh 2024-08-13 15:04:53 +08:00
Jensfrank
bfb733e2b9
Update Nlbench.sh 2024-08-13 15:04:44 +08:00
Jensfrank
63e0193f36
Update Nlbench_beta.sh 2024-08-13 14:53:44 +08:00
Jensfrank
de83bd263f
Update Nlbench_beta.sh 2024-08-13 14:40:05 +08:00
Jensfrank
f4abd4a5ae
Update Nlbench_beta.sh 2024-08-13 14:37:49 +08:00
Jensfrank
0071674bc0
Update version.sh 2024-08-08 23:43:59 +08:00
Jensfrank
2dec3cccd4
Update Nlbench.sh 2024-08-08 23:43:17 +08:00
Jensfrank
4863412594
Update Nlbench.sh 2024-07-31 13:34:53 +08:00
Jensfrank
63c1666916
Update Nlbench.sh 2024-07-31 13:33:11 +08:00
Jensfrank
eb09d4c142
Update version.sh 2024-07-31 12:49:08 +08:00
Jensfrank
45ee063a0d
Update Nlbench.sh 2024-07-31 12:48:38 +08:00
Jensfrank
1a753f480c
Update Nlbench.sh 2024-07-31 12:44:37 +08:00
Jensfrank
45a14e648c
Update version.sh 2024-07-31 12:40:26 +08:00
Jensfrank
6cdf1785a6
Update Nlbench.sh 2024-07-31 12:39:54 +08:00
Jensfrank
5324fe260c
Update version.sh 2024-07-29 12:52:09 +08:00
Jensfrank
c01e00459b
Update Nlbench.sh 2024-07-29 12:51:42 +08:00
Jensfrank
1e895e84ba
Update Nlbench_beta.sh 2024-07-26 15:49:48 +08:00
Jensfrank
97b13f0907
Update Nlbench.sh 2024-07-21 11:00:09 +08:00
Jensfrank
0586ec1980
Update version.sh 2024-07-21 10:59:49 +08:00
Jensfrank
024f12fb46
Update Nlbench.sh 2024-07-21 10:58:48 +08:00
Jensfrank
a37f17f3bb
Update Nlbench.sh 2024-07-21 10:49:21 +08:00
Jensfrank
7d2f1bfc95
Update version.sh 2024-07-21 10:35:34 +08:00
Jensfrank
62f81db561
Update Nlbench.sh 2024-07-21 10:35:10 +08:00
Jensfrank
d7a50bf7be
Update Nlbench_beta.sh 2024-07-21 09:26:38 +08:00
Jensfrank
0f78b66e3f
Update Nlbench.sh 2024-07-19 16:58:53 +08:00
Jensfrank
51161310db
Update Nlbench.sh 2024-07-18 22:49:42 +08:00
Jensfrank
db723e13f2
Update Nlbench.sh 2024-07-18 22:49:02 +08:00
Jensfrank
ac57a56e93
Update Nlbench.sh 2024-07-18 22:46:52 +08:00
Jensfrank
4dd959fc48
Update Nlbench.sh 2024-07-18 14:42:17 +08:00
Jensfrank
caa7b4f851
Update Nlbench_beta.sh 2024-07-18 14:37:44 +08:00
Jensfrank
e0b8048efc
Update Nlbench_beta.sh 2024-07-18 14:37:20 +08:00
Jensfrank
6fbfb3ed4e
Update Nlbench.sh 2024-07-18 14:32:51 +08:00
Jensfrank
c09a659d24
Update Nlbench.sh 2024-07-18 14:26:35 +08:00
Jensfrank
89082fffa2
Update Nlbench_beta.sh 2024-07-18 14:22:53 +08:00
Jensfrank
28f70512ef
Update Nlbench_beta.sh 2024-07-18 14:19:21 +08:00
Jensfrank
48f2083bc9
Update version.sh 2024-07-18 14:18:19 +08:00
Jensfrank
150f9c70ac
Update Nlbench_beta.sh 2024-07-18 14:17:51 +08:00
Jensfrank
2c444b6508
Update Nlbench_beta.sh 2024-07-18 14:16:44 +08:00
Jensfrank
d9232a458e
Update Nlbench_beta.sh 2024-07-18 13:42:13 +08:00
Jensfrank
a221eb623a
Update Nlbench_beta.sh 2024-07-18 13:41:55 +08:00
Jensfrank
266b08732f
Update Nlbench_beta.sh 2024-07-18 13:41:33 +08:00
Jensfrank
4afe766cb6
Update Nlbench_beta.sh 2024-07-18 01:51:47 +08:00
Jensfrank
c3583252ff
Update Nlbench.sh 2024-07-18 01:51:18 +08:00
Jensfrank
119fa06900
Update Nlbench.sh 2024-07-18 01:51:10 +08:00
Jensfrank
6e4f81ba91
Update Nlbench.sh 2024-07-18 01:51:01 +08:00
Jensfrank
c47ecf372a
Update Nlbench.sh 2024-07-18 01:50:52 +08:00
Jensfrank
39c87d942a
Update Nlbench.sh 2024-07-18 01:49:19 +08:00
Jensfrank
07ecfc8aff
Update Nlbench.sh 2024-07-18 01:45:21 +08:00
Jensfrank
e94ac3bc90
Update Nlbench.sh 2024-07-18 01:39:37 +08:00
Jensfrank
93b4d08be6
Update Nlbench.sh 2024-07-18 01:37:49 +08:00
Jensfrank
5159adf3f5
Update Nlbench.sh 2024-07-18 01:36:08 +08:00
Jensfrank
5b78fb9aaa
Update version.sh 2024-07-18 01:35:36 +08:00
Jensfrank
5835797759
Update Nlbench.sh 2024-07-18 01:29:42 +08:00
Jensfrank
e2bf586d68
Update Nlbench.sh 2024-07-18 01:21:19 +08:00
Jensfrank
8f0ecad1ea
Update Nlbench.sh 2024-07-18 01:19:41 +08:00
Jensfrank
a6b81ecba9
Update Nlbench.sh 2024-07-18 01:16:29 +08:00
Jensfrank
a845b1e827
Update version.sh 2024-07-18 01:11:44 +08:00
Jensfrank
a2452cda06
Update Nlbench.sh 2024-07-18 01:10:58 +08:00
Jensfrank
af344b81b2
Update Nlbench.sh 2024-07-18 01:07:53 +08:00
Jensfrank
c84aa8d0d5
Update Nlbench.sh 2024-07-18 01:04:57 +08:00
Jensfrank
45c2016731
Update Nlbench.sh 2024-07-18 01:02:12 +08:00
Jensfrank
5559e9449d
Delete update.sh 2024-07-18 00:54:21 +08:00
Jensfrank
261d786a62
Update update.sh 2024-07-18 00:40:53 +08:00
Jensfrank
10c491b71f
Update Nlbench_beta.sh 2024-07-18 00:40:00 +08:00
Jensfrank
768e62e123
Update Nlbench.sh 2024-07-18 00:39:49 +08:00
Jensfrank
3b1ba27c59
Update Nlbench.sh 2024-07-18 00:34:03 +08:00
Jensfrank
f3d7173f7e
Update Nlbench_beta.sh 2024-07-18 00:33:00 +08:00
Jensfrank
a8ab83ce08
Update Nlbench_beta.sh 2024-07-18 00:31:06 +08:00
Jensfrank
c083bbd454
Update Nlbench_beta.sh 2024-07-18 00:29:27 +08:00
Jensfrank
ef85846e45
Update Nlbench_beta.sh 2024-07-18 00:27:38 +08:00
Jensfrank
cf4f02b19a
Update Nlbench_beta.sh 2024-07-18 00:26:02 +08:00
Jensfrank
9d6e24a2cf
Update README.md 2024-07-18 00:25:14 +08:00
Jensfrank
35688835c2
Update version.sh 2024-07-18 00:24:43 +08:00
Jensfrank
e8a767906c
Update Nlbench.sh 2024-07-18 00:23:34 +08:00
Jensfrank
29259aebba
Update Nlbench_beta.sh 2024-07-18 00:23:10 +08:00
Jensfrank
7d9bfc494a
Update Nlbench_beta.sh 2024-07-17 23:45:42 +08:00
Jensfrank
8151aa8b69
Update Nlbench_beta.sh 2024-07-17 23:42:52 +08:00
Jensfrank
6851bb0d98
Update Nlbench_beta.sh 2024-07-17 23:32:23 +08:00
Jensfrank
07d9766d23
Update Nlbench_beta.sh 2024-07-17 23:30:27 +08:00
Jensfrank
bc622645ba
Update Nlbench_beta.sh 2024-07-17 23:28:08 +08:00
Jensfrank
c0dcb7df14
Update Nlbench_beta.sh 2024-07-17 23:27:06 +08:00
Jensfrank
e1acf23a23
Update Nlbench_beta.sh 2024-07-17 23:14:55 +08:00
Jensfrank
6a5cbf475f
Update Nlbench_beta.sh 2024-07-17 23:09:47 +08:00
Jensfrank
bf7f1f074b
Update Nlbench_beta.sh 2024-07-17 23:03:15 +08:00
Jensfrank
b1a2980d4a
Update Nlbench_beta.sh 2024-07-17 22:51:25 +08:00
Jensfrank
e0295cbeae
Update Nlbench_beta.sh 2024-07-17 22:49:14 +08:00
Jensfrank
c23cc2860c
Update Nlbench_beta.sh 2024-07-17 22:18:58 +08:00
Jensfrank
1bd3d294e1
Update Nlbench_beta.sh 2024-07-17 22:00:48 +08:00
Jensfrank
a752e437ce
Update Nlbench_beta.sh 2024-07-17 21:52:33 +08:00
Jensfrank
2bf1eceb44
Update Nlbench_beta.sh 2024-07-17 21:50:40 +08:00
Jensfrank
50553ef150
Update Nlbench_beta.sh 2024-07-17 21:45:16 +08:00
Jensfrank
dadafe6b8a
Update Nlbench_beta.sh 2024-07-17 21:43:37 +08:00
Jensfrank
8a7cbd1ff8
Update Nlbench_beta.sh 2024-07-17 21:41:08 +08:00
Jensfrank
ec702cc3d9
Update Nlbench_beta.sh 2024-07-17 21:39:47 +08:00
Jensfrank
76758cecac
Update Nlbench_beta.sh 2024-07-12 23:49:56 +08:00
Jensfrank
ebd773fe86
Update Nlbench_beta.sh 2024-07-12 23:47:47 +08:00
Jensfrank
e7f8a9f984
Update Nlbench.sh 2024-07-12 23:46:41 +08:00
Jensfrank
8016aea694
Update Nlbench_beta.sh 2024-07-12 08:25:53 +08:00
Jensfrank
6ad772aba2
Update Nlbench.sh 2024-07-12 08:25:18 +08:00
Jensfrank
b5065a66de
Update Nlbench.sh 2024-07-12 08:22:15 +08:00
Jensfrank
70b41330f5
Update Nlbench.sh 2024-07-12 08:18:29 +08:00
Jensfrank
d1d7761d06
Update version.sh 2024-07-12 01:27:11 +08:00
Jensfrank
e2ef388714
Update Nlbench.sh 2024-07-12 01:26:31 +08:00
Jensfrank
0f74c5fc26
Update Nlbench_beta.sh 2024-07-11 21:08:49 +08:00
Jensfrank
021cb43be2
Update Nlbench_beta.sh 2024-07-11 13:26:28 +08:00
Jensfrank
57da2ae4ca
Update Nlbench_beta.sh 2024-07-11 12:14:54 +08:00
Jensfrank
f577033dc7
Update Nlbench_beta.sh 2024-07-11 10:39:36 +08:00
Jensfrank
56d6fd897b
Update README.md 2024-07-08 00:38:55 +08:00
Jensfrank
5cb515e5e5
Update Nlbench_beta.sh 2024-07-07 02:27:38 +08:00
Jensfrank
260b1c5213
Update Nlbench_beta.sh 2024-07-07 02:25:58 +08:00
Jensfrank
496de84548
Update Nlbench_beta.sh 2024-07-07 02:23:39 +08:00
Jensfrank
099aeafdfe
Update Nlbench_beta.sh 2024-07-07 02:21:09 +08:00
Jensfrank
b3efb8dcdd
Update Nlbench_beta.sh 2024-07-07 02:18:40 +08:00
Jensfrank
1e3606a276
Update Nlbench.sh 2024-07-07 02:03:31 +08:00
Jensfrank
cff4b61262
Update Nlbench_beta.sh 2024-07-07 01:57:54 +08:00
Jensfrank
190d0eb62f
Update Nlbench_beta.sh 2024-07-07 01:55:34 +08:00
Jensfrank
11986515b1
Update README.md 2024-07-07 01:35:36 +08:00
Jensfrank
c92f28f64e
Update Nlbench.sh 2024-07-07 01:35:19 +08:00
Jensfrank
fcf9bdd81f
Update Nlbench_pro.sh 2024-07-06 21:32:06 +08:00
Jensfrank
c3e81f16be
Update Nlbench_beta.sh 2024-07-06 21:31:55 +08:00
Jensfrank
627dba51ef
Update Nlbench.sh 2024-07-06 21:31:27 +08:00
Jensfrank
860bd9c23f
Update README.md 2024-07-06 21:29:17 +08:00
Jensfrank
a380688b3a
Update Nlbench.sh 2024-07-05 15:53:43 +08:00
Jensfrank
b933e4c457
Update Nlbench.sh 2024-07-05 15:47:05 +08:00
Jensfrank
711417f008
Update version.sh 2024-07-05 15:24:39 +08:00
Jensfrank
2a21e90fa5
Update Nlbench.sh 2024-07-05 15:24:04 +08:00
Jensfrank
e48a22c916
Update Nlbench.sh 2024-07-05 15:22:30 +08:00
Jensfrank
a693a001a9
Update version.sh 2024-07-05 15:22:16 +08:00
Jensfrank
62c32c80e5
Update Nlbench_beta.sh 2024-07-05 15:07:36 +08:00
Jensfrank
58dcb1902f
Update Nlbench_beta.sh 2024-07-05 15:05:48 +08:00
Jensfrank
1a5a4c33c7
Update Nlbench.sh 2024-07-05 15:04:37 +08:00
Jensfrank
7b6e5f5d59
Update Nlbench.sh 2024-07-05 15:03:24 +08:00
Jensfrank
b6d288818d
Update Nlbench.sh 2024-07-05 15:01:10 +08:00
Jensfrank
1dc19b554d
Update Nlbench.sh 2024-07-05 15:00:00 +08:00
Jensfrank
e18d75c042
Update version.sh 2024-07-05 14:59:45 +08:00
Jensfrank
8b5b7b9dfe
Update Nlbench.sh 2024-07-05 14:58:18 +08:00
Jensfrank
cdcdbef516
Update Nlbench.sh 2024-07-05 14:55:01 +08:00
Jensfrank
0c682424f1
Update Nlbench.sh 2024-07-05 14:52:45 +08:00
丰仔
51f1544474
Update README.md 2024-07-05 14:50:13 +08:00
Jensfrank
746a2917ab
Update Nlbench.sh 2024-07-05 14:49:04 +08:00
Jensfrank
d10c687fdd
Update update.sh 2024-07-05 14:48:51 +08:00
Jensfrank
38fa0ee353
Update version.sh 2024-07-05 14:48:38 +08:00
Jensfrank
04397e4d55
Update Nlbench.sh 2024-07-05 14:46:23 +08:00
Jensfrank
d11b081f3f
Create update.sh 2024-07-05 14:36:37 +08:00
丰仔
2524f5b3ae
Update Nlbench.sh 2024-07-05 14:34:22 +08:00
Jensfrank
c16b8dc295
Update Nlbench.sh 2024-07-05 14:33:07 +08:00
Jensfrank
fff96e47e8
Update Nlbench.sh 2024-07-05 14:31:20 +08:00
Jensfrank
0c185852db
Update Nlbench.sh 2024-07-05 14:27:57 +08:00
Jensfrank
82e0b8b24b
Update Nlbench.sh 2024-07-05 14:25:44 +08:00
Jensfrank
dbaf51424e
Update Nlbench_beta.sh 2024-07-05 14:23:45 +08:00
Jensfrank
8262ff7701
Update Nlbench.sh 2024-07-05 14:23:36 +08:00
Jensfrank
2ff3cca09b
Update Nlbench_beta.sh 2024-07-05 14:19:51 +08:00
Jensfrank
c1d0bb1354
Update Nlbench.sh 2024-07-05 14:19:12 +08:00
Jensfrank
6799236803
Update README.md 2024-07-05 14:16:53 +08:00
Jensfrank
4cf622e43f
Update Nlbench.sh 2024-07-05 14:16:35 +08:00
Jensfrank
0e145847bf
Update Nlbench.sh 2024-07-05 14:15:34 +08:00
Jensfrank
3b14f8be1a
Update Nlbench_beta.sh 2024-07-05 14:11:21 +08:00
Jensfrank
1faf1bf016
Update Nlbench_beta.sh 2024-07-05 14:09:19 +08:00
Jensfrank
04fce18fde
Update Nlbench_beta.sh 2024-07-05 14:05:52 +08:00
Jensfrank
54a738b389
Update version.sh 2024-07-05 14:05:36 +08:00
Jensfrank
386fbe633e
Create version.sh 2024-07-05 14:04:42 +08:00
Jensfrank
a6b3cf7363
Update Nlbench_beta.sh 2024-07-05 14:03:16 +08:00
Jensfrank
4580a02a47
Update Nlbench_beta.sh 2024-07-05 14:03:06 +08:00
Jensfrank
9adb558c08
Update Nlbench_beta.sh 2024-07-05 14:02:27 +08:00
Jensfrank
e2e9977ce4
Update Nlbench.sh 2024-07-05 14:02:02 +08:00
Jensfrank
8f9c4c5c69
Update Nlbench_beta.sh 2024-07-05 13:59:56 +08:00
Jensfrank
0b6bf532de
Update Nlbench_beta.sh 2024-07-05 13:52:09 +08:00
Jensfrank
5f3af04441
Update Nlbench_beta.sh 2024-07-05 13:51:22 +08:00
Jensfrank
d291d70259
Update Nlbench_beta.sh 2024-07-05 13:40:38 +08:00
丰仔
9604bb0b5b
Update Nlbench.sh 2024-07-05 13:38:46 +08:00
Jensfrank
c9573bc88b
Update Nlbench_beta.sh 2024-07-05 13:35:24 +08:00
Jensfrank
f627ab5324
Update Nlbench_beta.sh 2024-07-05 13:32:20 +08:00
Jensfrank
3c2a4d48fa
Update Nlbench_beta.sh 2024-07-05 13:27:47 +08:00
Jensfrank
9136cbd43a
Update Nlbench_beta.sh 2024-07-05 13:26:20 +08:00
Jensfrank
3846a9128f
Update Nlbench_beta.sh 2024-07-05 13:18:18 +08:00
Jensfrank
ad59ac5a70
Update Nlbench_beta.sh 2024-07-05 13:01:13 +08:00
Jensfrank
3ee15eadea
Update Nlbench_beta.sh 2024-07-05 12:58:06 +08:00
Jensfrank
8b88817edf
Update Nlbench_beta.sh 2024-07-05 12:50:18 +08:00
Jensfrank
bf062ab919
Update Nlbench.sh 2024-07-05 12:22:04 +08:00
Jensfrank
021f6cae80
Update Nlbench.sh 2024-07-05 12:21:09 +08:00
Jensfrank
ff32689e90
Update Nlbench.sh 2024-07-05 12:20:28 +08:00
Jensfrank
0e33d153b2
Update Nlbench_beta.sh 2024-07-05 12:19:06 +08:00
Jensfrank
4468e961f5
Update Nlbench_beta.sh 2024-07-05 12:17:12 +08:00
Jensfrank
ba50bb0f02
Update Nlbench_beta.sh 2024-07-05 12:14:46 +08:00
丰仔
2472830d08
Update Nlbench.sh 2024-07-05 12:08:48 +08:00
Jensfrank
787e9b06a2
Update Nlbench_beta.sh 2024-07-05 00:54:21 +08:00
Jensfrank
948e8a66b3
Update Nlbench.sh 2024-07-05 00:54:07 +08:00
Jensfrank
b5aaac910a
Update README.md 2024-07-05 00:51:53 +08:00
Jensfrank
64997692c5
Update README.md 2024-07-05 00:50:52 +08:00
Jensfrank
646655e65e
Update README.md 2024-07-05 00:49:40 +08:00
Jensfrank
467c8dcf43
Update README.md 2024-07-05 00:48:25 +08:00
Jensfrank
2a208e7fcf
Update README.md 2024-07-05 00:41:59 +08:00
Jensfrank
ac693986ab
Update Nlbench.sh 2024-07-05 00:02:39 +08:00
Jensfrank
0b68e68853
Update Nlbench_beta.sh 2024-07-04 23:59:11 +08:00
Jensfrank
45f001faee
Update Nlbench.sh 2024-07-04 23:51:19 +08:00
Jensfrank
44a8637a74
Update Nlbench_beta.sh 2024-07-04 23:38:40 +08:00
Jensfrank
2f052b0eb3
Update Nlbench_beta.sh 2024-07-04 23:03:32 +08:00
Jensfrank
54df389641
Update Nlbench.sh 2024-07-04 22:45:54 +08:00
Jensfrank
7d60be548c
Update Nlbench_beta.sh 2024-07-04 22:42:27 +08:00
Jensfrank
45ddf88de5
Update Nlbench_beta.sh 2024-07-04 22:37:51 +08:00
Jensfrank
6c7f305438
Update Nlbench_beta.sh 2024-07-04 22:36:15 +08:00
Jensfrank
3fb2b4a38d
Update Nlbench_beta.sh 2024-07-04 22:28:29 +08:00
Jensfrank
762542e5e2
Update Nlbench_beta.sh 2024-07-04 22:24:54 +08:00
Jensfrank
4e6dc0ced3
Update Nlbench_beta.sh 2024-07-04 22:21:08 +08:00
Jensfrank
f66a5f465e
Update Nlbench_beta.sh 2024-07-04 22:16:33 +08:00
Jensfrank
2decf57a5d
Update Nlbench_beta.sh 2024-07-04 22:07:39 +08:00
Jensfrank
488aa28ade
Update Nlbench_beta.sh 2024-07-04 22:02:55 +08:00
Jensfrank
11a5304c91
Update Nlbench_beta.sh 2024-07-04 22:00:14 +08:00
Jensfrank
6f9d2a73fe
Update Nlbench_beta.sh 2024-07-04 21:52:23 +08:00
Jensfrank
f53d5d0797
Update Nlbench_beta.sh 2024-07-04 21:50:20 +08:00
Jensfrank
30fedc3e9f
Update Nlbench_beta.sh 2024-07-04 21:47:24 +08:00
Jensfrank
7dfa2607db
Update Nlbench_beta.sh 2024-07-04 21:38:48 +08:00
Jensfrank
ebd7dec552
Update Nlbench_beta.sh 2024-07-04 18:01:12 +08:00
Jensfrank
d8b96ddcf3
Update Nlbench.sh 2024-07-04 18:01:02 +08:00
Jensfrank
7a3f87529f
Update Nlbench_beta.sh 2024-07-04 17:56:50 +08:00
Jensfrank
d723a20c17
Update Nlbench.sh 2024-07-04 17:56:43 +08:00
Jensfrank
4869d27e1d
Update Nlbench.sh 2024-07-04 17:52:38 +08:00
Jensfrank
dd4bf090fc
Update Nlbench.sh 2024-07-04 17:49:51 +08:00
Jensfrank
5b9843d108
Update Nlbench.sh 2024-07-04 17:43:17 +08:00
Jensfrank
a2f9055567
Update Nlbench.sh 2024-07-04 17:33:20 +08:00
Jensfrank
ad2b0ced31
Update Nlbench.sh 2024-07-04 17:25:23 +08:00
Jensfrank
201945a3b9
Update Nlbench.sh 2024-07-04 17:20:08 +08:00
Jensfrank
4535060500
Update Nlbench.sh 2024-07-04 17:17:33 +08:00
Jensfrank
c88b1c2f10
Update Nlbench.sh 2024-07-04 17:15:15 +08:00
Jensfrank
dfc5c3af17
Update Nlbench.sh 2024-07-04 17:12:07 +08:00
Jensfrank
88dc30aa8b
Update iperf3_server.sh 2024-07-04 17:00:25 +08:00
Jensfrank
5ccf30ad3c
Create iperf3_server.sh 2024-07-04 16:56:21 +08:00
Jensfrank
9776b341e8
Update Nlbench.sh 2024-07-04 16:55:52 +08:00
Jensfrank
4578b6d59e
Update Nlbench.sh 2024-07-04 14:57:12 +08:00
Jensfrank
3cd59c51d5
Update Nlbench.sh 2024-07-04 14:48:59 +08:00
Jensfrank
305aa7a12c
Update Nlbench.sh 2024-07-04 14:39:41 +08:00
Jensfrank
21951d71ec
Update Nlbench.sh 2024-07-04 14:35:32 +08:00
Jensfrank
33db47ceb0
Update Nlbench_beta.sh 2024-07-04 14:09:10 +08:00
Jensfrank
59b13a66cb
Update Nlbench.sh 2024-07-04 14:06:09 +08:00
Jensfrank
7701da69ce
Update Nlbench_beta.sh 2024-07-04 13:01:58 +08:00
Jensfrank
9c49b306ea
Update Nlbench.sh 2024-07-04 13:01:39 +08:00
丰仔
90000a6e1b
Update README.md 2024-07-04 13:00:53 +08:00
Jensfrank
818def6b4d
Update Nlbench.sh 2024-07-04 13:00:30 +08:00
Jensfrank
ca3f0dd898
Update Nlbench_beta.sh 2024-07-04 12:54:39 +08:00
丰仔
2ecd3ea973
Update README.md 2024-07-04 12:48:27 +08:00
Jensfrank
d41afdcb16
Update Nlbench_pro.sh 2024-07-04 12:38:03 +08:00
Jensfrank
1b861bb230
Update Nlbench.sh 2024-07-04 12:32:04 +08:00
Jensfrank
35f5068309
Update Nlbench_pro.sh 2024-07-04 12:28:24 +08:00
16 changed files with 1724 additions and 2130 deletions

630
Cnbench.sh Normal file
View File

@ -0,0 +1,630 @@
#!/bin/bash
# 定义版本
CURRENT_VERSION="2025-01-21 v1.2.7" # 最新版本号
SCRIPT_URL="https://ghfast.top/https://raw.githubusercontent.com/nodeloc/nodeloc_vps_test/main/Nlbench.sh"
VERSION_URL="https://ghfast.top/https://raw.githubusercontent.com/nodeloc/nodeloc_vps_test/main/version.sh"
CLOUD_SERVICE_BASE="https://bench.nodeloc.cc"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;36m'
NC='\033[0m' # No Color
# 定义渐变颜色数组
colors=(
'\033[38;2;0;255;0m' # 绿色
'\033[38;2;64;255;0m'
'\033[38;2;128;255;0m'
'\033[38;2;192;255;0m'
'\033[38;2;255;255;0m' # 黄色
)
# 更新脚本
update_scripts() {
echo -e "${BLUE}┌─────────────────────────────────────────┐${NC}"
echo -e "${BLUE}│ NodeLoc VPS 测试脚本 │${NC}"
echo -e "${BLUE}│ 版本检查 │${NC}"
echo -e "${BLUE}└─────────────────────────────────────────┘${NC}"
REMOTE_VERSION=$(curl -s $VERSION_URL | tail -n 1 | grep -oP '(?<=#\s)[\d-]+\sv[\d.]+(?=\s-)')
if [ -z "$REMOTE_VERSION" ]; then
echo -e "${RED}✖ 无法获取远程版本信息。请检查您的网络连接。${NC}"
return 1
fi
echo -e "${BLUE}┌─────────────────────────────────────────┐${NC}"
echo -e "${BLUE}│ 版本历史 │${NC}"
echo -e "${BLUE}├─────────────────────────────────────────┤${NC}"
echo -e "${YELLOW} 当前版本: ${GREEN}$CURRENT_VERSION${NC}"
echo -e "${BLUE}├─────────────────────────────────────────┤${NC}"
echo -e "${YELLOW} 版本历史:${NC}"
curl -s $VERSION_URL | grep -oP '(?<=#\s)[\d-]+\sv[\d.]+(?=\s-)' |
while read version; do
if [ "$version" = "$CURRENT_VERSION" ]; then
echo -e " ${GREEN}$version ${NC}(当前版本)"
else
echo -e " $version"
fi
done
echo -e "${BLUE}└─────────────────────────────────────────┘${NC}"
if [ "$REMOTE_VERSION" != "$CURRENT_VERSION" ]; then
echo -e "\n${YELLOW}发现新版本: ${GREEN}$REMOTE_VERSION${NC}"
echo -e "${BLUE}正在更新...${NC}"
if curl -s -o /tmp/NLbench.sh $SCRIPT_URL; then
NEW_VERSION=$(grep '^CURRENT_VERSION=' /tmp/NLbench.sh | cut -d'"' -f2)
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
sed -i "s/^CURRENT_VERSION=.*/CURRENT_VERSION=\"$NEW_VERSION\"/" "$0"
if mv /tmp/NLbench.sh "$0"; then
chmod +x "$0"
echo -e "${GREEN}┌─────────────────────────────────────────┐${NC}"
echo -e "${GREEN}│ 脚本更新成功! │${NC}"
echo -e "${GREEN}└─────────────────────────────────────────┘${NC}"
echo -e "${YELLOW}新版本: ${GREEN}$NEW_VERSION${NC}"
echo -e "${YELLOW}正在重新启动脚本以应用更新...${NC}"
sleep 3
exec bash "$0"
else
echo -e "${RED}✖ 无法替换脚本文件。请检查权限。${NC}"
return 1
fi
else
echo -e "${GREEN}✔ 脚本已是最新版本。${NC}"
fi
else
echo -e "${RED}✖ 下载新版本失败。请稍后重试。${NC}"
return 1
fi
else
echo -e "\n${GREEN}✔ 脚本已是最新版本。${NC}"
fi
echo -e "${BLUE}┌─────────────────────────────────────────┐${NC}"
echo -e "${BLUE}│ 更新检查完成 │${NC}"
echo -e "${BLUE}└─────────────────────────────────────────┘${NC}"
}
# 检查 root 权限并获取 sudo 权限
check_root() {
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
}
# 检测操作系统
detect_os() {
if [ -f /etc/os-release ]; then
. /etc/os-release
os_type=$ID
elif type lsb_release >/dev/null 2>&1; then
os_type=$(lsb_release -si)
elif [ -f /etc/lsb-release ]; then
. /etc/lsb-release
os_type=$DISTRIB_ID
elif [ -f /etc/debian_version ]; then
os_type="debian"
elif [ -f /etc/fedora-release ]; then
os_type="fedora"
elif [ -f /etc/centos-release ]; then
os_type="centos"
else
os_type=$(uname -s)
fi
os_type=$(echo $os_type | tr '[:upper:]' '[:lower:]')
echo "检测到的操作系统: $os_type"
}
# 更新系统
update_system() {
detect_os
if [ $? -ne 0 ]; then
echo -e "${RED}无法检测操作系统。${NC}"
return 1
fi
case "${os_type,,}" in
ubuntu|debian|linuxmint|elementary|pop)
update_cmd="apt-get update"
upgrade_cmd="apt-get upgrade -y"
clean_cmd="apt-get autoremove -y"
;;
centos|rhel|fedora|rocky|almalinux|openeuler)
if command -v dnf &>/dev/null; then
update_cmd="dnf check-update"
upgrade_cmd="dnf upgrade -y"
clean_cmd="dnf autoremove -y"
else
update_cmd="yum check-update"
upgrade_cmd="yum upgrade -y"
clean_cmd="yum autoremove -y"
fi
;;
opensuse*|sles)
update_cmd="zypper refresh"
upgrade_cmd="zypper dup -y"
clean_cmd="zypper clean -a"
;;
arch|manjaro)
update_cmd="pacman -Sy"
upgrade_cmd="pacman -Syu --noconfirm"
clean_cmd="pacman -Sc --noconfirm"
;;
alpine)
update_cmd="apk update"
upgrade_cmd="apk upgrade"
clean_cmd="apk cache clean"
;;
gentoo)
update_cmd="emerge --sync"
upgrade_cmd="emerge -uDN @world"
clean_cmd="emerge --depclean"
;;
cloudlinux)
update_cmd="yum check-update"
upgrade_cmd="yum upgrade -y"
clean_cmd="yum clean all"
;;
*)
echo -e "${RED}不支持的 Linux 发行版: $os_type${NC}"
return 1
;;
esac
echo -e "${YELLOW}正在更新系统...${NC}"
sudo $update_cmd
if [ $? -eq 0 ]; then
sudo $upgrade_cmd
if [ $? -eq 0 ]; then
echo -e "${GREEN}系统更新完成。${NC}"
echo -e "${YELLOW}正在清理系统...${NC}"
sudo $clean_cmd
echo -e "${GREEN}系统清理完成。${NC}"
# 检查是否需要重启
if [ -f /var/run/reboot-required ]; then
echo -e "${YELLOW}系统更新需要重启才能完成。请在方便时重启系统。${NC}"
fi
return 0
fi
fi
echo -e "${RED}系统更新失败。${NC}"
return 1
}
# 定义支持的操作系统类型
SUPPORTED_OS=("ubuntu" "debian" "linuxmint" "elementary" "pop" "centos" "rhel" "fedora" "rocky" "almalinux" "openeuler" "opensuse" "sles" "arch" "manjaro" "alpine" "gentoo" "cloudlinux")
install_dependencies() {
echo -e "${YELLOW}正在检查并安装必要的依赖项...${NC}"
# 确保 os_type 已定义
if [ -z "$os_type" ]; then
detect_os
fi
# 更新系统
update_system || echo -e "${RED}系统更新失败。继续安装依赖项。${NC}"
# 安装依赖
local dependencies=("curl" "wget" "iperf3" "bc")
# 检查是否为支持的操作系统
if [[ ! " ${SUPPORTED_OS[@]} " =~ " ${os_type} " ]]; then
echo -e "${RED}不支持的操作系统: $os_type${NC}"
return 1
fi
case "${os_type,,}" in
debian|ubuntu)
export DEBIAN_FRONTEND=noninteractive # 禁用交互
echo "iperf3 iperf3/autostart boolean false" | sudo debconf-set-selections
install_cmd="apt-get install -yq"
sudo apt-get update -yq
;;
centos|rhel|fedora)
install_cmd="dnf install -y"
sudo dnf makecache
;;
alpine)
install_cmd="apk add --no-cache"
;;
gentoo)
install_cmd="emerge --quiet"
;;
arch|manjaro)
install_cmd="pacman -S --noconfirm"
sudo pacman -Sy --noconfirm
;;
*)
echo -e "${RED}未知的包管理器。请手动安装依赖项。${NC}"
return 1
;;
esac
# 安装依赖项
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &>/dev/null; then
echo -e "${YELLOW}正在安装 $dep...${NC}"
if ! sudo $install_cmd "$dep"; then
echo -e "${RED}无法安装 $dep。请手动安装此依赖项。${NC}"
fi
else
echo -e "${GREEN}$dep 已安装。${NC}"
fi
done
echo -e "${GREEN}依赖项检查和安装完成。${NC}"
}
# 获取IP地址和ISP信息
ip_address_and_isp() {
ipv4_address=$(curl -s --max-time 5 ipv4.ip.sb)
if [ -z "$ipv4_address" ]; then
ipv4_address=$(ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v '127.0.0.1' | head -n1)
fi
ipv6_address=$(curl -s --max-time 5 ipv6.ip.sb)
if [ -z "$ipv6_address" ]; then
ipv6_address=$(ip -6 addr show | grep -oP '(?<=inet6\s)[\da-f:]+' | grep -v '^::1' | grep -v '^fe80' | head -n1)
fi
# 获取ISP信息
isp_info=$(curl -s ipinfo.io/org)
# 检查是否为WARP或Cloudflare
is_warp=false
if echo "$isp_info" | grep -iq "cloudflare\|warp\|1.1.1.1"; then
is_warp=true
fi
# 判断使用IPv6还是IPv4
use_ipv6=false
if [ "$is_warp" = true ] || [ -z "$ipv4_address" ]; then
use_ipv6=true
fi
echo "IPv4: $ipv4_address"
echo "IPv6: $ipv6_address"
echo "ISP: $isp_info"
echo "Is WARP: $is_warp"
echo "Use IPv6: $use_ipv6"
}
# 检测VPS地理位置
detect_region() {
local country
country=$(curl -s ipinfo.io/country)
case $country in
"TW") echo "1" ;; # 台湾
"HK") echo "2" ;; # 香港
"JP") echo "3" ;; # 日本
"US" | "CA") echo "4" ;; # 北美
"BR" | "AR" | "CL") echo "5" ;; # 南美
"GB" | "DE" | "FR" | "NL" | "SE" | "NO" | "FI" | "DK" | "IT" | "ES" | "CH" | "AT" | "BE" | "IE" | "PT" | "GR" | "PL" | "CZ" | "HU" | "RO" | "BG" | "HR" | "SI" | "SK" | "LT" | "LV" | "EE") echo "6" ;; # 欧洲
"AU" | "NZ") echo "7" ;; # 大洋洲
"KR") echo "8" ;; # 韩国
"SG" | "MY" | "TH" | "ID" | "PH" | "VN") echo "9" ;; # 东南亚
"IN") echo "10" ;; # 印度
"ZA" | "NG" | "EG" | "KE" | "MA" | "TN" | "GH" | "CI" | "SN" | "UG" | "ET" | "MZ" | "ZM" | "ZW" | "BW" | "MW" | "NA" | "RW" | "SD" | "DJ" | "CM" | "AO") echo "11" ;; # 非洲
*) echo "0" ;; # 跨国平台
esac
}
# 统计使用次数
sum_run_times() {
local COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fnodeloc%2Fnodeloc_vps_test%2Fblob%2Fmain%2FNlbench.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
if [[ -n "$COUNT" ]]; then
daily_count=$(cut -d " " -f1 <<< "$COUNT")
total_count=$(cut -d " " -f3 <<< "$COUNT")
else
echo "Failed to fetch usage counts."
daily_count=0
total_count=0
fi
}
# 执行单个脚本并输出结果到文件
run_script() {
local script_number=$1
local output_file=$2
local temp_file=$(mktemp)
# 调用ip_address_and_isp函数获取IP地址和ISP信息
ip_address_and_isp
case $script_number in
# YABS
1)
echo -e "运行${YELLOW}YABS...${NC}"
curl -sL yabs.sh | bash -s -- -i -5 | tee "$temp_file"
sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i 's/\.\.\./\.\.\.\n/g' "$temp_file"
sed -i '/\.\.\./d' "$temp_file"
sed -i '/^\s*$/d' "$temp_file"
cp "$temp_file" "${output_file}_yabs"
;;
# IP质量
2)
echo -e "运行${YELLOW}IP质量测试...${NC}"
echo y | bash <(curl -Ls IP.Check.Place) | tee "$temp_file"
sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i -r 's/(⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏)/\n/g' "$temp_file"
sed -i -r '/正在检测/d' "$temp_file"
sed -i -n '/########################################################################/,${s/^.*\(########################################################################\)/\1/;p}' "$temp_file"
sed -i '/^$/d' "$temp_file"
cp "$temp_file" "${output_file}_ip_quality"
;;
# 流媒体解锁
3)
echo -e "运行${YELLOW}流媒体解锁测试...${NC}"
local region=$(detect_region)
bash <(curl -L -s media.ispvps.com) <<< "$region" | tee "$temp_file"
sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i -n '/流媒体平台及游戏区域限制测试/,$p' "$temp_file"
sed -i '1d' "$temp_file"
sed -i '/^$/d' "$temp_file"
cp "$temp_file" "${output_file}_streaming"
;;
# 响应测试
4)
echo -e "运行${YELLOW}响应测试...${NC}"
bash <(curl -sL https://nodebench.mereith.com/scripts/curltime.sh) | tee "$temp_file"
sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
cp "$temp_file" "${output_file}_response"
;;
# 多线程测速
5)
echo -e "运行${YELLOW}多线程测速...${NC}"
if [ "$use_ipv6" = true ]; then
echo "使用IPv6测试选项"
bash <(curl -sL https://ghfast.top/https://raw.githubusercontent.com/i-abc/Speedtest/main/speedtest.sh) <<< "3" | tee "$temp_file"
else
echo "使用IPv4测试选项"
bash <(curl -sL https://ghfast.top/https://raw.githubusercontent.com/i-abc/Speedtest/main/speedtest.sh) <<< "1" | tee "$temp_file"
fi
sed -r -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i -r '1,/序号\:/d' "$temp_file"
sed -i -r 's/(⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏)/\n/g' "$temp_file"
sed -i -r '/测试进行中/d' "$temp_file"
sed -i '/^$/d' "$temp_file"
cp "$temp_file" "${output_file}_multi_thread"
;;
# 单线程测速
6)
echo -e "运行${YELLOW}单线程测速...${NC}"
if [ "$use_ipv6" = true ]; then
echo "使用IPv6测试选项"
bash <(curl -sL https://ghfast.top/https://raw.githubusercontent.com/i-abc/Speedtest/main/speedtest.sh) <<< "17" | tee "$temp_file"
else
echo "使用IPv4测试选项"
bash <(curl -sL https://ghfast.top/https://raw.githubusercontent.com/i-abc/Speedtest/main/speedtest.sh) <<< "2" | tee "$temp_file"
fi
sed -r -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i -r '1,/序号\:/d' "$temp_file"
sed -i -r 's/(⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏)/\n/g' "$temp_file"
sed -i -r '/测试进行中/d' "$temp_file"
sed -i '/^$/d' "$temp_file"
cp "$temp_file" "${output_file}_single_thread"
;;
# 回程路由
7)
echo -e "运行${YELLOW}回程路由测试...${NC}"
if [ "$use_ipv6" = true ]; then
echo "使用IPv6测试选项"
wget -N --no-check-certificate https://ghfast.top/https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && bash AutoTrace.sh <<< "4" | tee "$temp_file"
else
echo "使用IPv4测试选项"
wget -N --no-check-certificate https://ghfast.top/https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && bash AutoTrace.sh <<< "1" | tee "$temp_file"
fi
sed -i -e 's/\x1B\[[0-9;]*[JKmsu]//g' -e '/No:1\/9 Traceroute to/,$!d' -e '/测试项/,+9d' -e '/信息/d' -e '/^\s*$/d' "$temp_file"
cp "$temp_file" "${output_file}_route"
;;
esac
rm "$temp_file"
echo -e "${GREEN}测试完成。${NC}"
}
# 生成最终的 Markdown 输出
generate_markdown_output() {
local base_output_file=$1
local temp_output_file="${base_output_file}.md"
local sections=("YABS" "IP质量" "流媒体" "响应" "多线程测速" "单线程测速" "回程路由")
local file_suffixes=("yabs" "ip_quality" "streaming" "response" "multi_thread" "single_thread" "route")
local empty_tabs=("去程路由" "Ping.pe" "哪吒 ICMP" "其他")
# 修改这里,添加 UTF-8 编码设置
echo "[tabs]" | iconv -f UTF-8 -t UTF-8//IGNORE > "$temp_output_file"
# 输出有内容的标签
for i in "${!sections[@]}"; do
section="${sections[$i]}"
suffix="${file_suffixes[$i]}"
if [ -f "${base_output_file}_${suffix}" ]; then
echo "[tab=\"$section\"]" | iconv -f UTF-8 -t UTF-8//IGNORE >> "$temp_output_file"
echo "\`\`\`" >> "$temp_output_file"
cat "${base_output_file}_${suffix}" | iconv -f UTF-8 -t UTF-8//IGNORE >> "$temp_output_file"
echo "\`\`\`" >> "$temp_output_file"
echo "[/tab]" >> "$temp_output_file"
rm "${base_output_file}_${suffix}"
fi
done
# 添加保留的空白标签
#for tab in "${empty_tabs[@]}"; do
# echo "[tab=\"$tab\"]" >> "$temp_output_file"
# echo "[/tab]" >> "$temp_output_file"
#done
echo "[/tabs]" >> "$temp_output_file"
# 上传文件 获取回调
local plain_uploaded_file=$(cat "${temp_output_file}" | curl -s -X POST --data-binary @- "${CLOUD_SERVICE_BASE}")
local plain_uploaded_file_path=$(echo "$plain_uploaded_file" | grep -oP "(?<=${CLOUD_SERVICE_BASE}).*")
local plain_uploaded_file_filename=$(basename "${plain_uploaded_file_path}")
if [ -n "$plain_uploaded_file" ]; then
local base_url=$(echo "${CLOUD_SERVICE_BASE}" | sed 's:/*$::')
local remote_url="${base_url}/result${plain_uploaded_file_path}"
echo -e "${remote_url}\r\nPlain ${plain_uploaded_file}" > "${plain_uploaded_file_filename}.url"
echo "测试结果已上传,您可以在以下链接查看:"
echo "${remote_url}"
echo "Plain ${plain_uploaded_file}"
echo "结果链接已保存到 ${plain_uploaded_file_filename}.url"
else
echo "上传失败. 结果已保存在本地文件 ${temp_output_file}"
fi
rm "$temp_output_file"
read -p "按回车键继续..." < /dev/tty
clear
}
# 执行全部脚本
run_all_scripts() {
local base_output_file="NLvps_results_$(date +%Y%m%d_%H%M%S)"
echo "开始执行全部测试脚本..."
for i in {1..10}; do
run_script $i "$base_output_file"
done
generate_markdown_output "$base_output_file"
clear
}
run_selected_scripts() {
clear
local base_output_file="NLvps_results_$(date +%Y%m%d_%H%M%S)"
echo -e "${YELLOW}Nodeloc VPS 自动测试脚本 $VERSION${NC}"
echo "1. Yabs"
echo "2. IP质量"
echo "3. 流媒体解锁"
echo "4. 响应测试"
echo "5. 多线程测试"
echo "6. 单线程测试"
echo "7. 回程路由"
echo "0. 返回"
while true; do
read -p "请输入要执行的脚本编号用英文逗号分隔例如1,2,3):" script_numbers < /dev/tty
if [[ "$script_numbers" =~ ^(0|10|[1-7])(,(0|10|[1-7]))*$ ]]; then
break
else
echo -e "${RED}无效输入请输入0-7之间的数字用英文逗号分隔。${NC}"
fi
done
if [[ "$script_numbers" == "0" ]]; then
clear
show_welcome
return # 确保退出函数,不再继续执行
fi
# 分割用户输入为数组
IFS=',' read -ra selected_scripts <<< "$script_numbers"
echo "开始执行选定的测试脚本..."
for number in "${selected_scripts[@]}"; do
clear
run_script "$number" "$base_output_file"
done
# 所有脚本执行完毕后生成 Markdown 输出
generate_markdown_output "$base_output_file"
}
# 主菜单
main_menu() {
echo -e "${GREEN}测试项目:${NC}YabsIP质量流媒体解锁响应测试多线程测试单线程测试回程路由。"
echo -e "${YELLOW}1. 执行所有测试脚本${NC}"
echo -e "${YELLOW}2. 选择特定测试脚本${NC}"
echo -e "${YELLOW}0. 退出${NC}"
# 提示输入并读取,从终端读取输入
read -p "请选择操作 [0-2]: " choice < /dev/tty
# 确保输入非空
if [[ -z "$choice" ]]; then
echo -e "${RED}输入为空,请重新输入。${NC}"
sleep 2s
clear
main_menu
return
fi
# 检查输入是否合法
case $choice in
1)
run_all_scripts
;;
2)
run_selected_scripts
;;
0)
echo -e "${RED}感谢使用NodeLoc聚合测试脚本已退出脚本期待你的下次使用${NC}"
exit 0
;;
*)
echo -e "${RED}无效选择,请重新输入。${NC}"
sleep 2s
clear
main_menu
;;
esac
}
# 输出欢迎信息
show_welcome() {
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo -e "${GREEN}Nodeloc聚合测试脚本 $CURRENT_VERSION ${NC}"
echo -e "${GREEN}GitHub地址: https://github.com/nodeloc/nodeloc_vps_test${NC}"
echo -e "${GREEN}Nodeloc社区: https://www.nodeloc.com/${NC}"
echo ""
echo -e "${colors[0]} _ _ ___ ____ _____ _ ___ ____ __ ______ ____ ${NC}"
echo -e "${colors[1]} | \ | |/ _ \| _ \| ____| | / _ \ / ___| \ \ / / _ \/ ___| ${NC}"
echo -e "${colors[2]} | \| | | | | | | | _| | | | | | | | \ \ / /| |_) \___ \ ${NC}"
echo -e "${colors[3]} | |\ | |_| | |_| | |___| |__| |_| | |___ \ V / | __/ ___) |${NC}"
echo -e "${colors[4]} |_| \_|\___/|____/|_____|_____\___/ \____| \_/ |_| |____/ ${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
echo -e "今日运行次数: ${RED}$daily_count${NC} 次,累计运行次数: ${RED}$total_count${NC}"
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
}
# 主函数
main() {
# 更新脚本
update_scripts
# 检查是不是root用户
check_root
# 检查并安装依赖
install_dependencies
# 调用函数获取统计数据
sum_run_times
# 主循环
while true; do
show_welcome
main_menu
done
}
# 运行主函数
main

View File

@ -1,44 +1,259 @@
#!/bin/bash
# 定义版本
VERSION="1.0.2"
CURRENT_VERSION="2025-01-21 v1.2.7" # 最新版本号
SCRIPT_URL="https://raw.githubusercontent.com/nodeloc/nodeloc_vps_test/main/Nlbench.sh"
VERSION_URL="https://raw.githubusercontent.com/nodeloc/nodeloc_vps_test/main/version.sh"
CLOUD_SERVICE_BASE="https://bench.nodeloc.cc"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
YELLOW='\033[0;33m'
BLUE='\033[0;36m'
NC='\033[0m' # No Color
# 检查 root 权限并获取 sudo 权限
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
# 定义渐变颜色数组
colors=(
'\033[38;2;0;255;0m' # 绿色
'\033[38;2;64;255;0m'
'\033[38;2;128;255;0m'
'\033[38;2;192;255;0m'
'\033[38;2;255;255;0m' # 黄色
)
# 更新脚本
update_scripts() {
echo -e "${BLUE}┌─────────────────────────────────────────┐${NC}"
echo -e "${BLUE}│ NodeLoc VPS 测试脚本 │${NC}"
echo -e "${BLUE}│ 版本检查 │${NC}"
echo -e "${BLUE}└─────────────────────────────────────────┘${NC}"
REMOTE_VERSION=$(curl -s $VERSION_URL | tail -n 1 | grep -oP '(?<=#\s)[\d-]+\sv[\d.]+(?=\s-)')
if [ -z "$REMOTE_VERSION" ]; then
echo -e "${RED}✖ 无法获取远程版本信息。请检查您的网络连接。${NC}"
return 1
fi
echo -e "${BLUE}┌─────────────────────────────────────────┐${NC}"
echo -e "${BLUE}│ 版本历史 │${NC}"
echo -e "${BLUE}├─────────────────────────────────────────┤${NC}"
echo -e "${YELLOW} 当前版本: ${GREEN}$CURRENT_VERSION${NC}"
echo -e "${BLUE}├─────────────────────────────────────────┤${NC}"
echo -e "${YELLOW} 版本历史:${NC}"
curl -s $VERSION_URL | grep -oP '(?<=#\s)[\d-]+\sv[\d.]+(?=\s-)' |
while read version; do
if [ "$version" = "$CURRENT_VERSION" ]; then
echo -e " ${GREEN}$version ${NC}(当前版本)"
else
echo -e " $version"
fi
done
echo -e "${BLUE}└─────────────────────────────────────────┘${NC}"
if [ "$REMOTE_VERSION" != "$CURRENT_VERSION" ]; then
echo -e "\n${YELLOW}发现新版本: ${GREEN}$REMOTE_VERSION${NC}"
echo -e "${BLUE}正在更新...${NC}"
if curl -s -o /tmp/NLbench.sh $SCRIPT_URL; then
NEW_VERSION=$(grep '^CURRENT_VERSION=' /tmp/NLbench.sh | cut -d'"' -f2)
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
sed -i "s/^CURRENT_VERSION=.*/CURRENT_VERSION=\"$NEW_VERSION\"/" "$0"
if mv /tmp/NLbench.sh "$0"; then
chmod +x "$0"
echo -e "${GREEN}┌─────────────────────────────────────────┐${NC}"
echo -e "${GREEN}│ 脚本更新成功! │${NC}"
echo -e "${GREEN}└─────────────────────────────────────────┘${NC}"
echo -e "${YELLOW}新版本: ${GREEN}$NEW_VERSION${NC}"
echo -e "${YELLOW}正在重新启动脚本以应用更新...${NC}"
sleep 3
exec bash "$0"
else
echo -e "${RED}✖ 无法替换脚本文件。请检查权限。${NC}"
return 1
fi
else
echo -e "${GREEN}✔ 脚本已是最新版本。${NC}"
fi
else
echo -e "${RED}✖ 下载新版本失败。请稍后重试。${NC}"
return 1
fi
else
echo -e "\n${GREEN}✔ 脚本已是最新版本。${NC}"
fi
echo -e "${BLUE}┌─────────────────────────────────────────┐${NC}"
echo -e "${BLUE}│ 更新检查完成 │${NC}"
echo -e "${BLUE}└─────────────────────────────────────────┘${NC}"
}
# 检查 root 权限并获取 sudo 权限
check_root() {
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
}
# 检测操作系统
detect_os() {
if [ -f /etc/os-release ]; then
. /etc/os-release
os_type=$ID
elif type lsb_release >/dev/null 2>&1; then
os_type=$(lsb_release -si)
elif [ -f /etc/lsb-release ]; then
. /etc/lsb-release
os_type=$DISTRIB_ID
elif [ -f /etc/debian_version ]; then
os_type="debian"
elif [ -f /etc/fedora-release ]; then
os_type="fedora"
elif [ -f /etc/centos-release ]; then
os_type="centos"
else
os_type=$(uname -s)
fi
os_type=$(echo $os_type | tr '[:upper:]' '[:lower:]')
echo "检测到的操作系统: $os_type"
}
# 更新系统
update_system() {
detect_os
if [ $? -ne 0 ]; then
echo -e "${RED}无法检测操作系统。${NC}"
return 1
fi
case "${os_type,,}" in
ubuntu|debian|linuxmint|elementary|pop)
update_cmd="apt-get update"
upgrade_cmd="apt-get upgrade -y"
clean_cmd="apt-get autoremove -y"
;;
centos|rhel|fedora|rocky|almalinux|openeuler)
if command -v dnf &>/dev/null; then
update_cmd="dnf check-update"
upgrade_cmd="dnf upgrade -y"
clean_cmd="dnf autoremove -y"
else
update_cmd="yum check-update"
upgrade_cmd="yum upgrade -y"
clean_cmd="yum autoremove -y"
fi
;;
opensuse*|sles)
update_cmd="zypper refresh"
upgrade_cmd="zypper dup -y"
clean_cmd="zypper clean -a"
;;
arch|manjaro)
update_cmd="pacman -Sy"
upgrade_cmd="pacman -Syu --noconfirm"
clean_cmd="pacman -Sc --noconfirm"
;;
alpine)
update_cmd="apk update"
upgrade_cmd="apk upgrade"
clean_cmd="apk cache clean"
;;
gentoo)
update_cmd="emerge --sync"
upgrade_cmd="emerge -uDN @world"
clean_cmd="emerge --depclean"
;;
cloudlinux)
update_cmd="yum check-update"
upgrade_cmd="yum upgrade -y"
clean_cmd="yum clean all"
;;
*)
echo -e "${RED}不支持的 Linux 发行版: $os_type${NC}"
return 1
;;
esac
echo -e "${YELLOW}正在更新系统...${NC}"
sudo $update_cmd
if [ $? -eq 0 ]; then
sudo $upgrade_cmd
if [ $? -eq 0 ]; then
echo -e "${GREEN}系统更新完成。${NC}"
echo -e "${YELLOW}正在清理系统...${NC}"
sudo $clean_cmd
echo -e "${GREEN}系统清理完成。${NC}"
# 检查是否需要重启
if [ -f /var/run/reboot-required ]; then
echo -e "${YELLOW}系统更新需要重启才能完成。请在方便时重启系统。${NC}"
fi
return 0
fi
fi
echo -e "${RED}系统更新失败。${NC}"
return 1
}
# 定义支持的操作系统类型
SUPPORTED_OS=("ubuntu" "debian" "linuxmint" "elementary" "pop" "centos" "rhel" "fedora" "rocky" "almalinux" "openeuler" "opensuse" "sles" "arch" "manjaro" "alpine" "gentoo" "cloudlinux")
# 检查并安装依赖
install_dependencies() {
echo -e "${YELLOW}正在检查并安装必要的依赖项...${NC}"
# 更新包列表
if ! sudo apt-get update; then
echo -e "${RED}无法更新包列表。请检查您的网络连接和系统设置。${NC}"
exit 1
# 确保 os_type 已定义
if [ -z "$os_type" ]; then
detect_os
fi
# 安装依赖
local dependencies=(
"curl"
"wget"
)
# 更新系统
update_system || echo -e "${RED}系统更新失败。继续安装依赖项。${NC}"
# 安装依赖
local dependencies=("curl" "wget" "iperf3" "bc")
# 检查是否为支持的操作系统
if [[ ! " ${SUPPORTED_OS[@]} " =~ " ${os_type} " ]]; then
echo -e "${RED}不支持的操作系统: $os_type${NC}"
return 1
fi
case "${os_type,,}" in
debian|ubuntu)
export DEBIAN_FRONTEND=noninteractive
echo "iperf3 iperf3/autostart boolean false" | sudo debconf-set-selections
install_cmd="apt-get install -yq"
sudo apt-get update -yq
;;
centos|rhel|fedora)
install_cmd="dnf install -y"
sudo dnf makecache
;;
alpine)
install_cmd="apk add --no-cache"
;;
gentoo)
install_cmd="emerge --quiet"
;;
arch|manjaro)
install_cmd="pacman -S --noconfirm"
sudo pacman -Sy --noconfirm
;;
*)
echo -e "${RED}未知的包管理器。请手动安装依赖项。${NC}"
return 1
;;
esac
# 安装依赖项
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &> /dev/null; then
if ! command -v "$dep" &>/dev/null; then
echo -e "${YELLOW}正在安装 $dep...${NC}"
if ! sudo apt-get install -y "$dep"; then
if ! sudo $install_cmd "$dep"; then
echo -e "${RED}无法安装 $dep。请手动安装此依赖项。${NC}"
fi
else
@ -47,11 +262,12 @@ install_dependencies() {
done
echo -e "${GREEN}依赖项检查和安装完成。${NC}"
clear
}
# 获取IP地址
ip_address() {
# 获取IP地址和ISP信息
ip_address_and_isp() {
ipv4_address=$(curl -s --max-time 5 ipv4.ip.sb)
if [ -z "$ipv4_address" ]; then
ipv4_address=$(ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v '127.0.0.1' | head -n1)
@ -61,6 +277,27 @@ ip_address() {
if [ -z "$ipv6_address" ]; then
ipv6_address=$(ip -6 addr show | grep -oP '(?<=inet6\s)[\da-f:]+' | grep -v '^::1' | grep -v '^fe80' | head -n1)
fi
# 获取ISP信息
isp_info=$(curl -s ipinfo.io/org)
# 检查是否为WARP或Cloudflare
is_warp=false
if echo "$isp_info" | grep -iq "cloudflare\|warp\|1.1.1.1"; then
is_warp=true
fi
# 判断使用IPv6还是IPv4
use_ipv6=false
if [ "$is_warp" = true ] || [ -z "$ipv4_address" ]; then
use_ipv6=true
fi
echo "IPv4: $ipv4_address"
echo "IPv6: $ipv6_address"
echo "ISP: $isp_info"
echo "Is WARP: $is_warp"
echo "Use IPv6: $use_ipv6"
}
# 检测VPS地理位置
@ -85,8 +322,7 @@ detect_region() {
# 统计使用次数
sum_run_times() {
local COUNT
COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/everett7623/nodeloc_vps_test/edit/main/Nlbench.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
local COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fnodeloc%2Fnodeloc_vps_test%2Fblob%2Fmain%2FNlbench.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
if [[ -n "$COUNT" ]]; then
daily_count=$(cut -d " " -f1 <<< "$COUNT")
total_count=$(cut -d " " -f3 <<< "$COUNT")
@ -97,97 +333,99 @@ sum_run_times() {
fi
}
# 调用函数获取统计数据
sum_run_times
# 更新系统
update_system() {
if command -v apt &>/dev/null; then
apt-get update && apt-get upgrade -y
elif command -v dnf &>/dev/null; then
dnf check-update && dnf upgrade -y
elif command -v yum &>/dev/null; then
yum check-update && yum upgrade -y
elif command -v apk &>/dev/null; then
apk update && apk upgrade
else
echo -e "${RED}不支持的Linux发行版${NC}"
return 1
fi
return 0
}
# 执行单个脚本并输出结果到文件
run_script() {
local script_number=$1
local output_file=$2
local temp_file=$(mktemp)
# 调用ip_address_and_isp函数获取IP地址和ISP信息
ip_address_and_isp
case $script_number in
# YABS
1)
echo -e "运行${YELLOW}YABS...${NC}"
wget -qO- yabs.sh | bash | tee "$temp_file"
curl -sL yabs.sh | bash -s -- -i -5 | tee "$temp_file"
sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i 's/\.\.\./\.\.\.\n/g' "$temp_file"
sed -i '/\.\.\./d' "$temp_file"
sed -i '/^\s*$/d' "$temp_file"
cp "$temp_file" "${output_file}_yabs"
;;
# 融合怪
2)
echo -e "运行${YELLOW}融合怪...${NC}"
curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh -m 1 <<< "y" | tee "$temp_file"
sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i 's/\.\.\.\.\.\./\.\.\.\.\.\.\n/g' "$temp_file"
sed -i '1,/\.\.\.\.\.\./d' "$temp_file"
sed -i '1,/\.\.\.\.\.\./d' "$temp_file"
cp "$temp_file" "${output_file}_fusion"
;;
# IP质量
3)
2)
echo -e "运行${YELLOW}IP质量测试...${NC}"
bash <(curl -Ls IP.Check.Place) | tee "$temp_file"
sed 's/\x1B\[[0-9;]*[JKmsu]//g; /\.\.\.\.\.\.\.\.\.\./d' "$temp_file" > "${output_file}_ip_quality"
echo y | bash <(curl -Ls IP.Check.Place) | tee "$temp_file"
sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i -r 's/(⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏)/\n/g' "$temp_file"
sed -i -r '/正在检测/d' "$temp_file"
sed -i -n '/########################################################################/,${s/^.*\(########################################################################\)/\1/;p}' "$temp_file"
sed -i '/^$/d' "$temp_file"
cp "$temp_file" "${output_file}_ip_quality"
;;
# 流媒体解锁
4)
3)
echo -e "运行${YELLOW}流媒体解锁测试...${NC}"
local region=$(detect_region)
bash <(curl -L -s media.ispvps.com) <<< "$region" |tee "$temp_file"
sed 's/\x1B\[[0-9;]*[JKmsu]//g; 1,/脚本适配/d' "$temp_file" > "${output_file}_streaming"
bash <(curl -L -s media.ispvps.com) <<< "$region" | tee "$temp_file"
sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i -n '/流媒体平台及游戏区域限制测试/,$p' "$temp_file"
sed -i '1d' "$temp_file"
sed -i '/^$/d' "$temp_file"
cp "$temp_file" "${output_file}_streaming"
;;
# 响应测试
5)
4)
echo -e "运行${YELLOW}响应测试...${NC}"
bash <(curl -sL https://nodebench.mereith.com/scripts/curltime.sh) |tee "$temp_file"
sed 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file" > "${output_file}_response"
bash <(curl -sL https://nodebench.mereith.com/scripts/curltime.sh) | tee "$temp_file"
sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
cp "$temp_file" "${output_file}_response"
;;
# 多线程测速
6)
5)
echo -e "运行${YELLOW}多线程测速...${NC}"
bash <(curl -sL bash.icu/speedtest) <<< "1" |tee "$temp_file"
if [ "$use_ipv6" = true ]; then
echo "使用IPv6测试选项"
bash <(curl -sL https://raw.githubusercontent.com/i-abc/Speedtest/main/speedtest.sh) <<< "3" | tee "$temp_file"
else
echo "使用IPv4测试选项"
bash <(curl -sL https://raw.githubusercontent.com/i-abc/Speedtest/main/speedtest.sh) <<< "1" | tee "$temp_file"
fi
sed -r -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i -r '1,/序号\:/d' "$temp_file"
sed -i -r 's/(⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏)/\n/g' "$temp_file"
sed -i -r '/测试进行中/d' "$temp_file"
sed -i '/^$/d' "$temp_file"
cp "$temp_file" "${output_file}_multi_thread"
;;
# 单线程测速
7)
6)
echo -e "运行${YELLOW}单线程测速...${NC}"
bash <(curl -sL bash.icu/speedtest) <<< "2" |tee "$temp_file"
if [ "$use_ipv6" = true ]; then
echo "使用IPv6测试选项"
bash <(curl -sL https://raw.githubusercontent.com/i-abc/Speedtest/main/speedtest.sh) <<< "17" | tee "$temp_file"
else
echo "使用IPv4测试选项"
bash <(curl -sL https://raw.githubusercontent.com/i-abc/Speedtest/main/speedtest.sh) <<< "2" | tee "$temp_file"
fi
sed -r -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i -r '1,/序号\:/d' "$temp_file"
sed -i -r 's/(⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏)/\n/g' "$temp_file"
sed -i -r '/测试进行中/d' "$temp_file"
sed -i '/^$/d' "$temp_file"
cp "$temp_file" "${output_file}_single_thread"
;;
# 回程路由
8)
7)
echo -e "运行${YELLOW}回程路由测试...${NC}"
wget -N --no-check-certificate https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && bash AutoTrace.sh <<< "1" |tee "$temp_file"
sed -e 's/\x1B\[[0-9;]*[JKmsu]//g' -e ' /测试项/,+9d' -e '/信息/d' -e '/^\s*$/d' "$temp_file" > "${output_file}_route"
if [ "$use_ipv6" = true ]; then
echo "使用IPv6测试选项"
wget -N --no-check-certificate https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && bash AutoTrace.sh <<< "4" | tee "$temp_file"
else
echo "使用IPv4测试选项"
wget -N --no-check-certificate https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && bash AutoTrace.sh <<< "1" | tee "$temp_file"
fi
sed -i -e 's/\x1B\[[0-9;]*[JKmsu]//g' -e '/No:1\/9 Traceroute to/,$!d' -e '/测试项/,+9d' -e '/信息/d' -e '/^\s*$/d' "$temp_file"
cp "$temp_file" "${output_file}_route"
;;
esac
rm "$temp_file"
@ -197,101 +435,56 @@ run_script() {
# 生成最终的 Markdown 输出
generate_markdown_output() {
local base_output_file=$1
local final_output_file="${base_output_file}.md"
local temp_output_file="${base_output_file}.md"
local sections=("YABS" "IP质量" "流媒体" "响应" "多线程测速" "单线程测速" "回程路由")
local file_suffixes=("yabs" "ip_quality" "streaming" "response" "multi_thread" "single_thread" "route")
local empty_tabs=("去程路由" "Ping.pe" "哪吒 ICMP" "其他")
echo "[tabs]" > "$final_output_file"
# 修改这里,添加 UTF-8 编码设置
echo "[tabs]" | iconv -f UTF-8 -t UTF-8//IGNORE > "$temp_output_file"
echo "[tab=\"YABS\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_yabs" ]; then
cat "${base_output_file}_yabs" >> "$final_output_file"
rm "${base_output_file}_yabs"
# 输出有内容的标签
for i in "${!sections[@]}"; do
section="${sections[$i]}"
suffix="${file_suffixes[$i]}"
if [ -f "${base_output_file}_${suffix}" ]; then
echo "[tab=\"$section\"]" | iconv -f UTF-8 -t UTF-8//IGNORE >> "$temp_output_file"
echo "\`\`\`" >> "$temp_output_file"
cat "${base_output_file}_${suffix}" | iconv -f UTF-8 -t UTF-8//IGNORE >> "$temp_output_file"
echo "\`\`\`" >> "$temp_output_file"
echo "[/tab]" >> "$temp_output_file"
rm "${base_output_file}_${suffix}"
fi
done
# 添加保留的空白标签
#for tab in "${empty_tabs[@]}"; do
# echo "[tab=\"$tab\"]" >> "$temp_output_file"
# echo "[/tab]" >> "$temp_output_file"
#done
echo "[/tabs]" >> "$temp_output_file"
# 上传文件 获取回调
local plain_uploaded_file=$(cat "${temp_output_file}" | curl -s -X POST --data-binary @- "${CLOUD_SERVICE_BASE}")
local plain_uploaded_file_path=$(echo "$plain_uploaded_file" | grep -oP "(?<=${CLOUD_SERVICE_BASE}).*")
local plain_uploaded_file_filename=$(basename "${plain_uploaded_file_path}")
if [ -n "$plain_uploaded_file" ]; then
local base_url=$(echo "${CLOUD_SERVICE_BASE}" | sed 's:/*$::')
local remote_url="${base_url}/result${plain_uploaded_file_path}"
echo -e "${remote_url}\r\nPlain ${plain_uploaded_file}" > "${plain_uploaded_file_filename}.url"
echo "测试结果已上传,您可以在以下链接查看:"
echo "${remote_url}"
echo "Plain ${plain_uploaded_file}"
echo "结果链接已保存到 ${plain_uploaded_file_filename}.url"
else
echo "上传失败. 结果已保存在本地文件 ${temp_output_file}"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"融合怪\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_fusion" ]; then
cat "${base_output_file}_fusion" >> "$final_output_file"
rm "${base_output_file}_fusion"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"IP质量\"]" >> "$final_output_file"
if [ -f "${base_output_file}_ip_quality" ]; then
cat "${base_output_file}_ip_quality" >> "$final_output_file"
rm "${base_output_file}_ip_quality"
fi
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"流媒体\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_streaming" ]; then
cat "${base_output_file}_streaming" >> "$final_output_file"
rm "${base_output_file}_streaming"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"响应\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_response" ]; then
cat "${base_output_file}_response" >> "$final_output_file"
rm "${base_output_file}_response"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"多线程测速\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_multi_thread" ]; then
cat "${base_output_file}_multi_thread" >> "$final_output_file"
rm "${base_output_file}_multi_thread"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"单线程测速\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_single_thread" ]; then
cat "${base_output_file}_single_thread" >> "$final_output_file"
rm "${base_output_file}_single_thread"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"回程路由\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_route" ]; then
cat "${base_output_file}_route" >> "$final_output_file"
rm "${base_output_file}_route"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"去程路由\"]" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"iperf3\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"Ping.pe\"]" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"哪吒 ICMP\"]" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"其他\"]" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[/tabs]" >> "$final_output_file"
echo "所有测试完成,结果已保存在 $final_output_file 中。"
read -p "按回车键继续..."
rm "$temp_output_file"
read -p "按回车键继续..." < /dev/tty
clear
}
@ -299,52 +492,75 @@ generate_markdown_output() {
run_all_scripts() {
local base_output_file="NLvps_results_$(date +%Y%m%d_%H%M%S)"
echo "开始执行全部测试脚本..."
for i in {1..8}; do
for i in {1..10}; do
run_script $i "$base_output_file"
done
generate_markdown_output "$base_output_file"
clear
}
# 执行选定的脚本
run_selected_scripts() {
clear
local base_output_file="NLvps_results_$(date +%Y%m%d_%H%M%S)"
echo -e "${YELLOW}Nodeloc VPS 自动测试脚本 $VERSION${NC}"
echo "1. Yabs"
echo "2. 融合怪"
echo "3. IP质量"
echo "4. 流媒体解锁"
echo "5. 响应测试"
echo "6. 多线程测试"
echo "7. 单线程测试"
echo "8. 回程路由"
echo "2. IP质量"
echo "3. 流媒体解锁"
echo "4. 响应测试"
echo "5. 多线程测试"
echo "6. 单线程测试"
echo "7. 回程路由"
echo "0. 返回"
read -p "请输入要执行的脚本编号用逗号分隔例如1,2,3):" script_numbers
IFS=',' read -ra selected_scripts <<< "$script_numbers"
echo "开始执行选定的测试脚本..."
if [ $script_numbers == "0" ]
then
while true; do
read -p "请输入要执行的脚本编号用英文逗号分隔例如1,2,3):" script_numbers < /dev/tty
if [[ "$script_numbers" =~ ^(0|10|[1-7])(,(0|10|[1-7]))*$ ]]; then
break
else
echo -e "${RED}无效输入请输入0-7之间的数字用英文逗号分隔。${NC}"
fi
done
if [[ "$script_numbers" == "0" ]]; then
clear
show_welcome
else
for number in "${selected_scripts[@]}"; do
clear
run_script "$number" "$base_output_file"
done
generate_markdown_output "$base_output_file"
return # 确保退出函数,不再继续执行
fi
# 分割用户输入为数组
IFS=',' read -ra selected_scripts <<< "$script_numbers"
echo "开始执行选定的测试脚本..."
for number in "${selected_scripts[@]}"; do
clear
run_script "$number" "$base_output_file"
done
# 所有脚本执行完毕后生成 Markdown 输出
generate_markdown_output "$base_output_file"
}
# 主菜单
main_menu() {
echo -e "${YELLOW}Nodeloc VPS 自动测试脚本 $VERSION${NC}"
echo -e "${GREEN}测试项目:${NC}Yabs融合怪IP质量流媒体解锁响应测试多线程测试单线程测试回程路由。"
echo -e "${GREEN}测试项目:${NC}YabsIP质量流媒体解锁响应测试多线程测试单线程测试回程路由。"
echo -e "${YELLOW}1. 执行所有测试脚本${NC}"
echo -e "${YELLOW}2. 选择特定测试脚本${NC}"
echo -e "${YELLOW}0. 退出${NC}"
read -p "请选择操作 [0-2]: " choice
# 提示输入并读取,从终端读取输入
read -p "请选择操作 [0-2]: " choice < /dev/tty
# 确保输入非空
if [[ -z "$choice" ]]; then
echo -e "${RED}输入为空,请重新输入。${NC}"
sleep 2s
clear
main_menu
return
fi
# 检查输入是否合法
case $choice in
1)
run_all_scripts
@ -358,28 +574,29 @@ main_menu() {
;;
*)
echo -e "${RED}无效选择,请重新输入。${NC}"
sleep 3s
sleep 2s
clear
show_welcome
main_menu
;;
esac
}
# 输出欢迎信息
show_welcome() {
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "Nodeloc_VPS_自动脚本测试 $VERSION"
echo "GitHub地址: https://github.com/everett7623/nodeloc_vps_test"
echo "VPS选购: https://www.nodeloc.com/vps"
echo -e "${GREEN}Nodeloc聚合测试脚本 $CURRENT_VERSION ${NC}"
echo -e "${GREEN}GitHub地址: https://github.com/nodeloc/nodeloc_vps_test${NC}"
echo -e "${GREEN}Nodeloc社区: https://www.nodeloc.com/${NC}"
echo ""
echo -e "${YELLOW}# # ##### #### ###### # #### #### # # #### ####${NC}"
echo -e "${YELLOW}## # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # ##### # # # # # # #### ####${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# ## ##### #### ###### ###### #### #### #### # ####${NC}"
echo -e "${colors[0]} _ _ ___ ____ _____ _ ___ ____ __ ______ ____ ${NC}"
echo -e "${colors[1]} | \ | |/ _ \| _ \| ____| | / _ \ / ___| \ \ / / _ \/ ___| ${NC}"
echo -e "${colors[2]} | \| | | | | | | | _| | | | | | | | \ \ / /| |_) \___ \ ${NC}"
echo -e "${colors[3]} | |\ | |_| | |_| | |___| |__| |_| | |___ \ V / | __/ ___) |${NC}"
echo -e "${colors[4]} |_| \_|\___/|____/|_____|_____\___/ \____| \_/ |_| |____/ ${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
@ -391,10 +608,17 @@ show_welcome() {
# 主函数
main() {
# 更新脚本
update_scripts
# 检查是不是root用户
check_root
# 检查并安装依赖
install_dependencies
# 获取统计数据
# 调用函数获取统计数据
sum_run_times
# 主循环

View File

@ -1,341 +0,0 @@
#!/bin/bash
# 定义版本
VERSION="2.2.0"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 检查 root 权限并获取 sudo 权限
check_root() {
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
}
# 检查并安装依赖
install_dependencies() {
echo -e "${YELLOW}正在检查并安装必要的依赖项...${NC}"
local dependencies=("curl" "wget" "iperf3" "awk" "sed")
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &> /dev/null; then
echo -e "${YELLOW}正在安装 $dep...${NC}"
if ! sudo apt-get install -y "$dep"; then
echo -e "${RED}无法安装 $dep。请手动安装此依赖项。${NC}"
fi
else
echo -e "${GREEN}$dep 已安装。${NC}"
fi
done
echo -e "${GREEN}依赖项检查和安装完成。${NC}"
}
# 获取IP地址
get_ip_address() {
ipv4_address=$(curl -s --max-time 5 ipv4.ip.sb)
[ -z "$ipv4_address" ] && ipv4_address=$(ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v '127.0.0.1' | head -n1)
ipv6_address=$(curl -s --max-time 5 ipv6.ip.sb)
[ -z "$ipv6_address" ] && ipv6_address=$(ip -6 addr show | grep -oP '(?<=inet6\s)[\da-f:]+' | grep -v '^::1' | grep -v '^fe80' | head -n1)
}
# 检测VPS地理位置
detect_region() {
local country
country=$(curl -s ipinfo.io/country)
case $country in
"TW") echo "1" ;; # 台湾
"HK") echo "2" ;; # 香港
"JP") echo "3" ;; # 日本
"US" | "CA") echo "4" ;; # 北美
"BR" | "AR" | "CL") echo "5" ;; # 南美
"GB" | "DE" | "FR" | "NL" | "SE" | "NO" | "FI" | "DK" | "IT" | "ES" | "CH" | "AT" | "BE" | "IE" | "PT" | "GR" | "PL" | "CZ" | "HU" | "RO" | "BG" | "HR" | "SI" | "SK" | "LT" | "LV" | "EE") echo "6" ;; # 欧洲
"AU" | "NZ") echo "7" ;; # 大洋洲
"KR") echo "8" ;; # 韩国
"SG" | "MY" | "TH" | "ID" | "PH" | "VN") echo "9" ;; # 东南亚
"IN") echo "10" ;; # 印度
"ZA" | "NG" | "EG" | "KE" | "MA" | "TN" | "GH" | "CI" | "SN" | "UG" | "ET" | "MZ" | "ZM" | "ZW" | "BW" | "MW" | "NA" | "RW" | "SD" | "DJ" | "CM" | "AO") echo "11" ;; # 非洲
*) echo "0" ;; # 跨国平台
esac
}
# 统计使用次数
sum_run_times() {
local COUNT
COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/everett7623/nodeloc_vps_test/edit/main/Nlbench.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
if [[ -n "$COUNT" ]]; then
daily_count=$(cut -d " " -f1 <<< "$COUNT")
total_count=$(cut -d " " -f3 <<< "$COUNT")
else
echo "Failed to fetch usage counts."
daily_count=0
total_count=0
fi
}
# 显示欢迎信息
show_welcome() {
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "Nodeloc_VPS_自动脚本测试 $VERSION"
echo "GitHub地址: https://github.com/everett7623/nodeloc_vps_test"
echo "VPS选购: https://www.nodeloc.com/vps"
echo ""
echo -e "${YELLOW}# # ##### #### ###### # #### #### # # #### ####${NC}"
echo -e "${YELLOW}## # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # ##### # # # # # # #### ####${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# ## ##### #### ###### ###### #### #### #### # ####${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
echo -e "今日运行次数: ${RED}$daily_count${NC} 次,累计运行次数: ${RED}$total_count${NC}"
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
}
# Markdown 转义函数
escape_markdown() {
sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g'
}
# 执行YABS测试
run_yabs() {
echo "执行YABS测试..."
yabs_result=$(wget -qO- yabs.sh | bash)
echo "$yabs_result" | escape_markdown > yabs_result.txt
}
# 执行融合怪测试
run_fusion() {
echo "执行融合怪测试..."
fusion_result=$(curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh)
echo "$fusion_result" | awk '/A Bench Script/{f=1} f; /短链/{f=0}' | escape_markdown > fusion_result.txt
}
# 执行IP质量测试
run_ip_quality() {
echo "执行IP质量测试..."
ip_quality_result=$(bash <(curl -Ls IP.Check.Place))
local start_line=$(echo "$ip_quality_result" | grep -n '正在检测黑名单数据库' | tail -n 1 | cut -d ':' -f 1)
start_line=$((start_line + 1)) # 移动到下一行
local end_line=$(echo "$ip_quality_result" | grep -n '按回车键返回主菜单' | head -n 1 | cut -d ':' -f 1)
if [ -n "$start_line" ] && [ -n "$end_line" ]; then
ip_quality_result=$(tail -n +"$start_line" <<< "$ip_quality_result" | head -n $(($end_line - $start_line)) | escape_markdown)
elif [ -n "$start_line" ]; then
ip_quality_result=$(tail -n +"$start_line" <<< "$ip_quality_result" | escape_markdown)
fi
echo "$ip_quality_result" > ip_quality_result.txt
}
# 执行流媒体解锁测试
run_streaming() {
echo "执行流媒体解锁测试..."
region=$(detect_region)
streaming_result=$(bash <(curl -L -s media.ispvps.com) $region)
echo "$streaming_result" | awk '/项目地址/{f=1} f; /检测脚本当天运行次数/{f=0}' | escape_markdown > streaming_result.txt
}
# 执行响应测试
run_response() {
echo "执行响应测试..."
response_result=$(bash <(curl -sL https://nodebench.mereith.com/scripts/curltime.sh))
echo "$response_result" | escape_markdown > response_result.txt
}
# 执行三网测速(多线程)
run_speedtest_multi() {
echo "执行三网测速(多线程)..."
speedtest_multi_result=$(bash <(curl -sL bash.icu/speedtest) 1)
echo "$speedtest_multi_result" | sed -e '1,/序号\:/d' -e '/测试进行中/d' -e '/^\s*$/d' | escape_markdown > speedtest_multi_result.txt
}
# 执行三网测速(单线程)
run_speedtest_single() {
echo "执行三网测速(单线程)..."
speedtest_single_result=$(bash <(curl -sL bash.icu/speedtest) 2)
echo "$speedtest_single_result" | sed -e '1,/序号\:/d' -e '/测试进行中/d' -e '/^\s*$/d' | escape_markdown > speedtest_single_result.txt
}
# 执行回程路由测试
run_traceroute() {
echo "执行回程路由测试..."
traceroute_result=$(wget -N --no-check-certificate https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && bash AutoTrace.sh)
echo "$traceroute_result" | sed -e '/测试项/,+9d' -e '/信息/d' -e '/^\s*$/d' | escape_markdown > traceroute_result.txt
}
# 生成Markdown文件
generate_markdown() {
local output_file="nodeloc_vps_test_$(date +%Y%m%d_%H%M%S).md"
{
echo "# VPS 测试结果"
echo "测试时间:$(date)"
echo ""
echo "## 系统信息"
echo "- IPv4: $ipv4_address"
echo "- IPv6: $ipv6_address"
echo ""
echo "[tabs]"
echo "[tab=\"YABS\"]"
echo "\`\`\`"
cat yabs_result.txt
echo "\`\`\`"
echo "[/tab]"
echo "[tab=\"融合怪\"]"
echo "\`\`\`"
cat fusion_result.txt
echo "\`\`\`"
echo "[/tab]"
echo "[tab=\"IP质量\"]"
echo "\`\`\`"
echo "########################################################################"
cat ip_quality_result.txt
echo "\`\`\`"
echo "[/tab]"
echo "[tab=\"流媒体\"]"
echo "\`\`\`"
cat streaming_result.txt
echo "\`\`\`"
echo "[/tab]"
echo "[tab=\"响应\"]"
echo "\`\`\`"
cat response_result.txt
echo "\`\`\`"
echo "[/tab]"
echo "[tab=\"多线程测速\"]"
echo "\`\`\`"
cat speedtest_multi_result.txt
echo "\`\`\`"
echo "[/tab]"
echo "[tab=\"单线程测速\"]"
echo "\`\`\`"
cat speedtest_single_result.txt
echo "\`\`\`"
echo "[/tab]"
echo "[tab=\"回程路由\"]"
echo "\`\`\`"
cat traceroute_result.txt
echo "\`\`\`"
echo "[/tab]"
echo "[tab=\"去程路由\"]"
echo "[/tab]"
echo "[tab=\"iperf3\"]"
echo "\`\`\`"
echo "\`\`\`"
echo "[/tab]"
echo "[tab=\"Ping.pe\"]"
echo "[/tab]"
echo "[tab=\"哪吒 ICMP\"]"
echo "[/tab]"
echo "[tab=\"其他\"]"
echo "[/tab]"
echo "[/tabs]"
} > "$output_file"
echo "测试结果已保存到 $output_file"
}
# 主函数
main() {
check_root
install_dependencies
get_ip_address
sum_run_times
show_welcome
while true; do
echo "请选择测试选项:"
echo "1. 测试全部脚本"
echo "2. 选择特定脚本测试"
echo "0. 退出"
read -p "请输入选项 (0-2): " option
case $option in
1)
run_yabs
run_fusion
run_ip_quality
run_streaming
run_response
run_speedtest_multi
run_speedtest_single
run_traceroute
break
;;
2)
echo "请输入要测试的脚本编号用逗号分隔如1,2,3:"
echo "1. Yabs"
echo "2. 融合怪"
echo "3. IP质量"
echo "4. 流媒体解锁"
echo "5. 响应测试"
echo "6. 多线程测试"
echo "7. 单线程测试"
echo "8. 回程路由"
read -p "输入选择: " scripts
IFS=',' read -ra ADDR <<< "$scripts"
for i in "${ADDR[@]}"; do
case $i in
1) run_yabs ;;
2) run_fusion ;;
3) run_ip_quality ;;
4) run_streaming ;;
5) run_response ;;
6) run_speedtest_multi ;;
7) run_speedtest_single ;;
8) run_traceroute ;;
*) echo "无效的选项: $i" ;;
esac
done
break
;;
0)
echo "感谢使用,再见!"
exit 0
;;
*)
echo "无效的选项,请重新输入。"
;;
esac
done
generate_markdown
# 清理临时文件
rm -f yabs_result.txt fusion_result.txt ip_quality_result.txt streaming_result.txt response_result.txt speedtest_multi_result.txt speedtest_single_result.txt traceroute_result.txt
echo "测试完成!结果已保存到 nodeloc_vps_test_$(date +%Y%m%d_%H%M%S).md"
}
# 执行主函数
main

View File

@ -1,406 +0,0 @@
#!/bin/bash
# 定义版本
VERSION="1.0.2"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 检查 root 权限并获取 sudo 权限
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
# 检查并安装依赖
install_dependencies() {
echo -e "${YELLOW}正在检查并安装必要的依赖项...${NC}"
# 更新包列表
if ! sudo apt-get update; then
echo -e "${RED}无法更新包列表。请检查您的网络连接和系统设置。${NC}"
exit 1
fi
# 安装依赖
local dependencies=(
"curl"
"wget"
)
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &> /dev/null; then
echo -e "${YELLOW}正在安装 $dep...${NC}"
if ! sudo apt-get install -y "$dep"; then
echo -e "${RED}无法安装 $dep。请手动安装此依赖项。${NC}"
fi
else
echo -e "${GREEN}$dep 已安装。${NC}"
fi
done
echo -e "${GREEN}依赖项检查和安装完成。${NC}"
clear
}
# 获取IP地址
ip_address() {
ipv4_address=$(curl -s --max-time 5 ipv4.ip.sb)
if [ -z "$ipv4_address" ]; then
ipv4_address=$(ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v '127.0.0.1' | head -n1)
fi
ipv6_address=$(curl -s --max-time 5 ipv6.ip.sb)
if [ -z "$ipv6_address" ]; then
ipv6_address=$(ip -6 addr show | grep -oP '(?<=inet6\s)[\da-f:]+' | grep -v '^::1' | grep -v '^fe80' | head -n1)
fi
}
# 检测VPS地理位置
detect_region() {
local country
country=$(curl -s ipinfo.io/country)
case $country in
"TW") echo "1" ;; # 台湾
"HK") echo "2" ;; # 香港
"JP") echo "3" ;; # 日本
"US" | "CA") echo "4" ;; # 北美
"BR" | "AR" | "CL") echo "5" ;; # 南美
"GB" | "DE" | "FR" | "NL" | "SE" | "NO" | "FI" | "DK" | "IT" | "ES" | "CH" | "AT" | "BE" | "IE" | "PT" | "GR" | "PL" | "CZ" | "HU" | "RO" | "BG" | "HR" | "SI" | "SK" | "LT" | "LV" | "EE") echo "6" ;; # 欧洲
"AU" | "NZ") echo "7" ;; # 大洋洲
"KR") echo "8" ;; # 韩国
"SG" | "MY" | "TH" | "ID" | "PH" | "VN") echo "9" ;; # 东南亚
"IN") echo "10" ;; # 印度
"ZA" | "NG" | "EG" | "KE" | "MA" | "TN" | "GH" | "CI" | "SN" | "UG" | "ET" | "MZ" | "ZM" | "ZW" | "BW" | "MW" | "NA" | "RW" | "SD" | "DJ" | "CM" | "AO") echo "11" ;; # 非洲
*) echo "0" ;; # 跨国平台
esac
}
# 统计使用次数
sum_run_times() {
local COUNT
COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/everett7623/nodeloc_vps_test/edit/main/Nlbench.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
if [[ -n "$COUNT" ]]; then
daily_count=$(cut -d " " -f1 <<< "$COUNT")
total_count=$(cut -d " " -f3 <<< "$COUNT")
else
echo "Failed to fetch usage counts."
daily_count=0
total_count=0
fi
}
# 调用函数获取统计数据
sum_run_times
# 更新系统
update_system() {
if command -v apt &>/dev/null; then
apt-get update && apt-get upgrade -y
elif command -v dnf &>/dev/null; then
dnf check-update && dnf upgrade -y
elif command -v yum &>/dev/null; then
yum check-update && yum upgrade -y
elif command -v apk &>/dev/null; then
apk update && apk upgrade
else
echo -e "${RED}不支持的Linux发行版${NC}"
return 1
fi
return 0
}
# 执行单个脚本并输出结果到文件
run_script() {
local script_number=$1
local output_file=$2
local temp_file=$(mktemp)
case $script_number in
# YABS
1)
echo -e "运行${YELLOW}YABS...${NC}"
wget -qO- yabs.sh | bash | tee "$temp_file"
sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i 's/\.\.\./\.\.\.\n/g' "$temp_file"
sed -i '/\.\.\./d' "$temp_file"
sed -i '/^\s*$/d' "$temp_file"
cp "$temp_file" "${output_file}_yabs"
;;
# 融合怪
2)
echo -e "运行${YELLOW}融合怪...${NC}"
curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh -m 1 | tee "$temp_file"
sed -e 's/\x1B\[[0-9;]*[JKmsu]//g' -e '1,/--------------------- A Bench Script By spiritlhl ----------------------/d' "$temp_file"
sed -i '1,/--------------------- A Bench Script By spiritlhl ----------------------/d' "$temp_file"
cp "$temp_file" "${output_file}_fusion"
;;
# IP质量
3)
echo -e "运行${YELLOW}IP质量测试...${NC}"
bash <(curl -Ls IP.Check.Place) | tee "$temp_file"
sed 's/\x1B\[[0-9;]*[JKmsu]//g; /\.\.\.\.\.\.\.\.\.\./d' "$temp_file" > "${output_file}_ip_quality"
;;
# 流媒体解锁
4)
echo -e "运行${YELLOW}流媒体解锁测试...${NC}"
local region=$(detect_region)
bash <(curl -L -s media.ispvps.com) <<< "$region" |tee "$temp_file"
sed 's/\x1B\[[0-9;]*[JKmsu]//g; 1,/脚本适配/d' "$temp_file" > "${output_file}_streaming"
;;
# 响应测试
5)
echo -e "运行${YELLOW}响应测试...${NC}"
bash <(curl -sL https://nodebench.mereith.com/scripts/curltime.sh) |tee "$temp_file"
sed 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file" > "${output_file}_response"
;;
# 多线程测速
6)
echo -e "运行${YELLOW}多线程测速...${NC}"
bash <(curl -sL bash.icu/speedtest) <<< "1" |tee "$temp_file"
sed -r -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i -r '1,/序号\:/d' "$temp_file"
sed -i -r 's/(⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏)/\n/g' "$temp_file"
sed -i -r '/测试进行中/d' "$temp_file"
cp "$temp_file" "${output_file}_multi_thread"
;;
# 单线程测速
7)
echo -e "运行${YELLOW}单线程测速...${NC}"
bash <(curl -sL bash.icu/speedtest) <<< "2" |tee "$temp_file"
sed -r -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i -r '1,/序号\:/d' "$temp_file"
sed -i -r 's/(⠋|⠙|⠹|⠸|⠼|⠴|⠦|⠧|⠇|⠏)/\n/g' "$temp_file"
sed -i -r '/测试进行中/d' "$temp_file"
cp "$temp_file" "${output_file}_single_thread"
;;
# 回程路由
8)
echo -e "运行${YELLOW}回程路由测试...${NC}"
wget -N --no-check-certificate https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && bash AutoTrace.sh <<< "1" |tee "$temp_file"
sed -e 's/\x1B\[[0-9;]*[JKmsu]//g' -e ' /测试项/,+9d' -e '/信息/d' -e '/^\s*$/d' "$temp_file" > "${output_file}_route"
;;
esac
rm "$temp_file"
echo -e "${GREEN}测试完成。${NC}"
}
# 生成最终的 Markdown 输出
generate_markdown_output() {
local base_output_file=$1
local final_output_file="${base_output_file}.md"
echo "[tabs]" > "$final_output_file"
echo "[tab=\"YABS\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_yabs" ]; then
cat "${base_output_file}_yabs" >> "$final_output_file"
rm "${base_output_file}_yabs"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"融合怪\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_fusion" ]; then
cat "${base_output_file}_fusion" >> "$final_output_file"
rm "${base_output_file}_fusion"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"IP质量\"]" >> "$final_output_file"
if [ -f "${base_output_file}_ip_quality" ]; then
cat "${base_output_file}_ip_quality" >> "$final_output_file"
rm "${base_output_file}_ip_quality"
fi
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"流媒体\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_streaming" ]; then
cat "${base_output_file}_streaming" >> "$final_output_file"
rm "${base_output_file}_streaming"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"响应\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_response" ]; then
cat "${base_output_file}_response" >> "$final_output_file"
rm "${base_output_file}_response"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"多线程测速\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_multi_thread" ]; then
cat "${base_output_file}_multi_thread" >> "$final_output_file"
rm "${base_output_file}_multi_thread"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"单线程测速\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_single_thread" ]; then
cat "${base_output_file}_single_thread" >> "$final_output_file"
rm "${base_output_file}_single_thread"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"回程路由\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
if [ -f "${base_output_file}_route" ]; then
cat "${base_output_file}_route" >> "$final_output_file"
rm "${base_output_file}_route"
fi
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"去程路由\"]" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"iperf3\"]" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
echo "\`\`\`" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"Ping.pe\"]" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"哪吒 ICMP\"]" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[tab=\"其他\"]" >> "$final_output_file"
echo "[/tab]" >> "$final_output_file"
echo "[/tabs]" >> "$final_output_file"
echo "所有测试完成,结果已保存在 $final_output_file 中。"
read -p "按回车键继续..."
clear
}
# 执行全部脚本
run_all_scripts() {
local base_output_file="NLvps_results_$(date +%Y%m%d_%H%M%S)"
echo "开始执行全部测试脚本..."
for i in {1..8}; do
run_script $i "$base_output_file"
done
generate_markdown_output "$base_output_file"
clear
}
# 执行选定的脚本
run_selected_scripts() {
clear
local base_output_file="NLvps_results_$(date +%Y%m%d_%H%M%S)"
echo -e "${YELLOW}Nodeloc VPS 自动测试脚本 $VERSION${NC}"
echo "1. Yabs"
echo "2. 融合怪"
echo "3. IP质量"
echo "4. 流媒体解锁"
echo "5. 响应测试"
echo "6. 多线程测试"
echo "7. 单线程测试"
echo "8. 回程路由"
echo "0. 返回"
read -p "请输入要执行的脚本编号用逗号分隔例如1,2,3):" script_numbers
IFS=',' read -ra selected_scripts <<< "$script_numbers"
echo "开始执行选定的测试脚本..."
if [ $script_numbers == "0" ]
then
clear
show_welcome
else
for number in "${selected_scripts[@]}"; do
clear
run_script "$number" "$base_output_file"
done
generate_markdown_output "$base_output_file"
fi
}
# 主菜单
main_menu() {
echo -e "${YELLOW}Nodeloc VPS 自动测试脚本 $VERSION${NC}"
echo -e "${GREEN}测试项目:${NC}Yabs融合怪IP质量流媒体解锁响应测试多线程测试单线程测试回程路由。"
echo -e "${YELLOW}1. 执行所有测试脚本${NC}"
echo -e "${YELLOW}2. 选择特定测试脚本${NC}"
echo -e "${YELLOW}0. 退出${NC}"
read -p "请选择操作 [0-2]: " choice
case $choice in
1)
run_all_scripts
;;
2)
run_selected_scripts
;;
0)
echo -e "${RED}感谢使用NodeLoc聚合测试脚本已退出脚本期待你的下次使用${NC}"
exit 0
;;
*)
echo -e "${RED}无效选择,请重新输入。${NC}"
sleep 3s
clear
show_welcome
;;
esac
}
# 输出欢迎信息
show_welcome() {
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "Nodeloc_VPS_自动脚本测试 $VERSION"
echo "GitHub地址: https://github.com/everett7623/nodeloc_vps_test"
echo "VPS选购: https://www.nodeloc.com/vps"
echo ""
echo -e "${YELLOW}# # ##### #### ###### # #### #### # # #### ####${NC}"
echo -e "${YELLOW}## # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # ##### # # # # # # #### ####${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# ## ##### #### ###### ###### #### #### #### # ####${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
echo -e "今日运行次数: ${RED}$daily_count${NC} 次,累计运行次数: ${RED}$total_count${NC}"
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
}
# 主函数
main() {
# 检查并安装依赖
install_dependencies
# 获取统计数据
sum_run_times
# 主循环
while true; do
show_welcome
main_menu
done
}
# 运行主函数
main

View File

@ -1,44 +1,64 @@
# NodeLoc聚合测评脚本
# NodeLoc聚合测评脚本 [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Feverett7623%2Fnodeloc_vps_test%2Fblob%2Fmain%2FNlbench.sh&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)
这是NodeLoc提供给各位用户的主机聚合测评脚本可一键自动对主机进行Yabs、融合怪、IP质量、流媒体等测评测评结束后将会保存结果为MarkDown文件方便快速上传至NodeLoc论坛
这是NodeLoc提供给各位用户的主机聚合测评脚本可一键自动对主机进行Yabs、融合怪、IP质量、流媒体解锁三网测速回程路由等测评测评结束后会生成一个txt文件可在线自行复制内容 发到NodeLoc论坛。
**版本:** 2024-07-03 v1.0.2
**版本:** 2025-01-21 v1.2.7
**Github地址** https://github.com/everett7623/nodeloc_vps_test
**Github地址** https://github.com/nodeloc/nodeloc_vps_test
**VPS 选购:** [NodeLoc VPS](https://www.nodeloc.com/vps)
### 使用方法
确保用户为ROOT主机网络通畅复制下面任意命令运行
**Debian/Ubuntu/Deepin**
**支持CentOS/Debian/Ubuntu/Deepin**
```bash
curl -o Nlbench.sh https://raw.githubusercontent.com/nodeloc/nodeloc_vps_test/main/Nlbench.sh && chmod +x Nlbench.sh && ./Nlbench.sh
```
wget -O Nlbench.sh https://raw.githubusercontent.com/everett7623/nodeloc_vps_test/main/Nlbench.sh && chmod +x Nlbench.sh && ./Nlbench.sh
** 短链接
```bash
curl -sSL abc.sd | bash
```
**CentOS**
```
curl -fsSL https://raw.githubusercontent.com/everett7623/nodeloc_vps_test/main/Nlbench.sh -o vps_scripts.sh&& chmod +x vps_scripts.sh && ./vps_scripts.sh
** 中国大陆
```bash
curl -o Nlbench.sh https://ghfast.top/https://raw.githubusercontent.com/nodeloc/nodeloc_vps_test/main/Cnbench.sh && chmod +x Nlbench.sh && ./Nlbench.sh
```
### 效果图
![image](https://s.rmimg.com/2024/07/03/568e9f492ca50cd0af4cce8b88a6f156.png)
#### 运行截图
![image](https://s.rmimg.com/2024/09/21/56db40f55c1d901066fe15973b70af06.png)
![image](https://s.rmimg.com/2024/07/03/b13a1c30c5ad58d6ad56c8ce0cdbb43c.png)
![image](https://s.rmimg.com/2024/09/21/b6a48d97e8124f452ef069901fe727d6.png)
![image](https://s.rmimg.com/2024/07/03/40fa7d2f292b798199ef2b58d25e624b.png)
![image](https://s.rmimg.com/2024/09/21/d697aac320074e6a0316aea2ae953efd.png)
**测试结束后将生成MarkDown格式的文件可直接将文件内容复制到[NodeLoc论坛](https://www.nodeloc.com/),无需进行更多操作**
#### 生成内容
**测试结束后将生成一个txt文件点击或者复制到浏览器后可直接点击复制到[NodeLoc论坛](https://www.nodeloc.com/),无需进行更多操作**
![image](https://github.com/user-attachments/assets/543a7741-943d-412c-9db7-58e5c66754c2)
![image](https://github.com/user-attachments/assets/8f7b5cf7-a566-422b-9aca-56a7fbb237be)
### 引用的脚本
本脚本仅为各类脚本聚合,未对官方脚本文件进行任何更改,但我们不对官方脚本的安全性负责
## 免责声明
* NodeLoc聚合测评脚本属于自用分享工具本脚本仅为各类脚本聚合。
* 工具中所有脚本均来自互联网,未对官方脚本文件进行任何更改,不对脚本安全性负责。如果你比较在意安全,请勿使用各类一键脚本。
## 问题反馈
如果您在使用过程中遇到问题,或者有功能建议,欢迎通过 [GitHub Issues](https://github.com/everett7623/nodeloc_vps_test/issues) 提交反馈。
## 许可协议
本项目采用 [AGPL-3.0 license](LICENSE) 许可。
### 鸣谢
1. [Yabs脚本](https://yabs.sh)——[masonr](https://github.com/masonr)
2. [融合怪脚本](https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh)——[spirit lhl](https://gitlab.com/spiritysdx)
3. [IP质量测试脚本](https://IP.Check.Place)——[xykt](https://github.com/xykt/)
4. [流媒体测试脚本](https://media.ispvps.com)——[xykt](https://github.com/xykt/)
5. [响应测试脚本](https://nodebench.mereith.com/scripts/curltime.sh)——[nodebench](https://nodebench.mereith.com)
6. [测速脚本](https://bash.icu/speedtest)——[i-abc](https://github.com/i-abc)
7. [测速脚本](https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh)——[陈豪](https://github.com/Chennhaoo/)
7. [回程测试脚本](https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh)——[陈豪](https://github.com/Chennhaoo/)
特别感谢以上作者提供的脚本
### 问题与反馈
如果您在使用过程中遇到问题,或者有功能建议,欢迎通过 [GitHub Issues](https://github.com/everett7623/nodeloc_vps_test/issues) 提交反馈。

47
iperf3_server.sh Normal file
View File

@ -0,0 +1,47 @@
#!/bin/bash
# 检查是否以 root 权限运行
if [ "$EUID" -ne 0 ]; then
echo "请以 root 权限运行此脚本"
exit 1
fi
# 检查 iperf3 是否安装
if ! command -v iperf3 &> /dev/null; then
echo "iperf3 未安装. 正在尝试安装..."
if command -v apt-get &> /dev/null; then
apt-get update && apt-get install -y iperf3
elif command -v yum &> /dev/null; then
yum install -y iperf3
else
echo "无法安装 iperf3。请手动安装。"
exit 1
fi
fi
# 创建 systemd 服务文件
cat << EOF > /etc/systemd/system/iperf3-server.service
[Unit]
Description=iperf3 Server
After=network.target
[Service]
ExecStart=/usr/bin/iperf3 -s
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
EOF
# 重新加载 systemd启用并启动服务
systemctl daemon-reload
systemctl enable iperf3-server.service
systemctl start iperf3-server.service
echo "iperf3 服务器已设置为在后台运行,并将在系统重启后自动启动。"
echo "使用以下命令管理服务:"
echo " 启动: systemctl start iperf3-server"
echo " 停止: systemctl stop iperf3-server"
echo " 重启: systemctl restart iperf3-server"
echo " 查看状态: systemctl status iperf3-server"

View File

@ -1,161 +0,0 @@
#!/bin/bash
# 定义版本
VERSION="1.0.0"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 检查 root 权限并获取 sudo 权限
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
# 检查并安装依赖
install_dependencies() {
echo -e "${YELLOW}正在检查并安装必要的依赖项...${NC}"
# 更新包列表
if ! sudo apt-get update; then
echo -e "${RED}无法更新包列表。请检查您的网络连接和系统设置。${NC}"
exit 1
fi
# 安装依赖
local dependencies=(
"curl"
"wget"
)
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &> /dev/null; then
echo -e "${YELLOW}正在安装 $dep...${NC}"
if ! sudo apt-get install -y "$dep"; then
echo -e "${RED}无法安装 $dep。请手动安装此依赖项。${NC}"
fi
else
echo -e "${GREEN}$dep 已安装。${NC}"
fi
done
echo -e "${GREEN}依赖项检查和安装完成。${NC}"
clear
}
# 统计使用次数
sum_run_times() {
local COUNT
COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/everett7623/nodeloc_vps_test/blob/main/nodeloc_vps_autotest.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
if [[ -n "$COUNT" ]]; then
daily_count=$(cut -d " " -f1 <<< "$COUNT")
total_count=$(cut -d " " -f3 <<< "$COUNT")
else
echo "Failed to fetch usage counts."
daily_count=0
total_count=0
fi
}
# 调用函数获取统计数据
sum_run_times
# 输出欢迎信息
show_welcome() {
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "Nodeloc_VPS_自动脚本测试 $VERSION"
echo "GitHub地址: https://github.com/everett7623/nodeloc_vps_test"
echo "VPS选购: https://www.nodeloc.com/vps"
echo ""
echo -e "${YELLOW}# # ##### #### ###### # #### #### # # #### ####${NC}"
echo -e "${YELLOW}## # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # ##### # # # # # # #### ####${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# ## ##### #### ###### ###### #### #### #### # ####${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
echo -e "今日运行次数: ${RED}$daily_count${NC} 次,累计运行次数: ${RED}$total_count${NC}"
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "一键脚本将测试以下项目:"
echo "融合怪"
echo ""
echo -e "${RED}按任意键开始测试...${NC}"
read -n 1 -s
clear
}
# 定义一个数组来存储每个命令的输出
declare -a test_results
# 在每个命令执行后保存结果
run_and_capture() {
local command_output
command_output=$(eval "$1" 2>&1)
test_results+=("$command_output")
echo "$command_output"
}
# 去除融合怪板块板块ANSI转义码
fusion_process_output() {
local input="$1"
# 使用更全面的 sed 命令去除所有 ANSI 转义码
echo "$input" | sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g' | awk '/A Bench Script/{f=1} f; /短链/{f=0}'
}
# 运行所有测试
run_all_tests() {
echo -e "${RED}开始测试,测试时间较长,请耐心等待...${NC}"
# 融合怪
echo -e "运行${YELLOW}融合怪...${NC}"
fusion_result=$(run_and_capture "curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && echo '1' | bash ecs.sh")
# 格式化结果
echo -e "${YELLOW}此报告由Nodeloc_VPS_自动脚本测试生成...${NC}"
format_results
}
# 格式化结果为 Markdown
format_results() {
# 处理融合怪结果
local processed_fusion_result
processed_fusion_result=$(fusion_process_output "$fusion_result")
result="[tabs]
[tab=\"融合怪\"]
\`\`\`
$processed_fusion_result
\`\`\`
[/tab]
[/tabs]"
echo "$result" > results.md
echo -e "${YELLOW}结果已保存到 results.md 文件中。${NC}"
}
# 主函数
main() {
install_dependencies
show_welcome
run_all_tests
echo -e "${YELLOW}所有测试完成可到results.md复制到Nodeloc使用。${NC}"
read -n 1 -s
echo "最终测试结果如下:" >&2
cat results.md >&2
}
main

View File

@ -1,171 +0,0 @@
#!/bin/bash
# 定义版本
VERSION="1.0.0"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 检查 root 权限并获取 sudo 权限
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
# 检查并安装依赖
install_dependencies() {
echo -e "${YELLOW}正在检查并安装必要的依赖项...${NC}"
# 更新包列表
if ! sudo apt-get update; then
echo -e "${RED}无法更新包列表。请检查您的网络连接和系统设置。${NC}"
exit 1
fi
# 安装依赖
local dependencies=(
"curl"
"wget"
)
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &> /dev/null; then
echo -e "${YELLOW}正在安装 $dep...${NC}"
if ! sudo apt-get install -y "$dep"; then
echo -e "${RED}无法安装 $dep。请手动安装此依赖项。${NC}"
fi
else
echo -e "${GREEN}$dep 已安装。${NC}"
fi
done
echo -e "${GREEN}依赖项检查和安装完成。${NC}"
clear
}
# 统计使用次数
sum_run_times() {
local COUNT
COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/everett7623/nodeloc_vps_test/blob/main/nodeloc_vps_autotest.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
if [[ -n "$COUNT" ]]; then
daily_count=$(cut -d " " -f1 <<< "$COUNT")
total_count=$(cut -d " " -f3 <<< "$COUNT")
else
echo "Failed to fetch usage counts."
daily_count=0
total_count=0
fi
}
# 调用函数获取统计数据
sum_run_times
# 输出欢迎信息
show_welcome() {
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "Nodeloc_VPS_自动脚本测试 $VERSION"
echo "GitHub地址: https://github.com/everett7623/nodeloc_vps_test"
echo "VPS选购: https://www.nodeloc.com/vps"
echo ""
echo -e "${YELLOW}# # ##### #### ###### # #### #### # # #### ####${NC}"
echo -e "${YELLOW}## # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # ##### # # # # # # #### ####${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# ## ##### #### ###### ###### #### #### #### # ####${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
echo -e "今日运行次数: ${RED}$daily_count${NC} 次,累计运行次数: ${RED}$total_count${NC}"
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "一键脚本将测试以下项目:"
echo "IP质量"
echo ""
echo -e "${RED}按任意键开始测试...${NC}"
read -n 1 -s
clear
}
# 定义一个数组来存储每个命令的输出
declare -a test_results
# 在每个命令执行后保存结果
run_and_capture() {
local command_output
command_output=$(eval "$1" 2>&1)
test_results+=("$command_output")
echo "$command_output"
}
# 去除IP质量板块ANSI转义码并截取
ip_process_output() {
local input="$1"
local start_line=$(echo "$input" | grep -n '正在检测黑名单数据库' | tail -n 1 | cut -d ':' -f 1)
start_line=$((start_line + 1)) # 移动到下一行
local end_line=$(echo "$input" | grep -n '按回车键返回主菜单' | head -n 1 | cut -d ':' -f 1)
if [ -n "$start_line" ] && [ -n "$end_line" ]; then
tail -n +"$start_line" <<< "$input" | head -n $(($end_line - $start_line)) | sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g'
elif [ -n "$start_line" ]; then
tail -n +"$start_line" <<< "$input" | sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g'
else
echo "未找到合适的日志内容。"
fi
}
# 运行所有测试
run_all_tests() {
echo -e "${RED}开始测试,测试时间较长,请耐心等待...${NC}"
# IP质量
echo -e "运行${YELLOW}IP质量测试...${NC}"
ip_quality_result=$(run_and_capture "bash <(curl -Ls IP.Check.Place)")
# 格式化结果
echo -e "${YELLOW}此报告由Nodeloc_VPS_自动脚本测试生成...${NC}"
format_results
}
# 格式化结果为 Markdown
format_results() {
# 处理IP质量结果
local processed_ip_result
processed_ip_result=$(ip_process_output "$ip_quality_result")
result="[tabs]
[tab=\"IP质量\"]
\`\`\`
########################################################################
$processed_ip_result
\`\`\`
[/tab]
[/tabs]"
echo "$result" > results.md
echo -e "${YELLOW}结果已保存到 results.md 文件中。${NC}"
}
# 主函数
main() {
install_dependencies
show_welcome
run_all_tests
echo -e "${YELLOW}所有测试完成可到results.md复制到Nodeloc使用。${NC}"
read -n 1 -s
echo "最终测试结果如下:" >&2
cat results.md >&2
}
main

View File

@ -1,182 +0,0 @@
#!/bin/bash
# 定义版本
VERSION="1.0.0"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 检查 root 权限并获取 sudo 权限
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
# 检查并安装依赖
install_dependencies() {
echo -e "${YELLOW}正在检查并安装必要的依赖项...${NC}"
# 更新包列表
if ! sudo apt-get update; then
echo -e "${RED}无法更新包列表。请检查您的网络连接和系统设置。${NC}"
exit 1
fi
# 安装依赖
local dependencies=(
"curl"
"wget"
)
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &> /dev/null; then
echo -e "${YELLOW}正在安装 $dep...${NC}"
if ! sudo apt-get install -y "$dep"; then
echo -e "${RED}无法安装 $dep。请手动安装此依赖项。${NC}"
fi
else
echo -e "${GREEN}$dep 已安装。${NC}"
fi
done
echo -e "${GREEN}依赖项检查和安装完成。${NC}"
clear
}
# 检测VPS地理位置
detect_region() {
local country
country=$(curl -s ipinfo.io/country)
case $country in
"TW") echo "1" ;; # 台湾
"HK") echo "2" ;; # 香港
"JP") echo "3" ;; # 日本
"US" | "CA") echo "4" ;; # 北美
"BR" | "AR" | "CL") echo "5" ;; # 南美
"GB" | "DE" | "FR" | "NL" | "SE" | "NO" | "FI" | "DK" | "IT" | "ES" | "CH" | "AT" | "BE" | "IE" | "PT" | "GR" | "PL" | "CZ" | "HU" | "RO" | "BG" | "HR" | "SI" | "SK" | "LT" | "LV" | "EE") echo "6" ;; # 欧洲
"AU" | "NZ") echo "7" ;; # 大洋洲
"KR") echo "8" ;; # 韩国
"SG" | "MY" | "TH" | "ID" | "PH" | "VN") echo "9" ;; # 东南亚
"IN") echo "10" ;; # 印度
"ZA" | "NG" | "EG" | "KE" | "MA" | "TN" | "GH" | "CI" | "SN" | "UG" | "ET" | "MZ" | "ZM" | "ZW" | "BW" | "MW" | "NA" | "RW" | "SD" | "DJ" | "CM" | "AO") echo "11" ;; # 非洲
*) echo "0" ;; # 跨国平台
esac
}
# 统计使用次数
sum_run_times() {
local COUNT
COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/everett7623/nodeloc_vps_test/blob/main/nodeloc_vps_autotest.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
if [[ -n "$COUNT" ]]; then
daily_count=$(cut -d " " -f1 <<< "$COUNT")
total_count=$(cut -d " " -f3 <<< "$COUNT")
else
echo "Failed to fetch usage counts."
daily_count=0
total_count=0
fi
}
# 调用函数获取统计数据
sum_run_times
# 输出欢迎信息
show_welcome() {
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "Nodeloc_VPS_自动脚本测试 $VERSION"
echo "GitHub地址: https://github.com/everett7623/nodeloc_vps_test"
echo "VPS选购: https://www.nodeloc.com/vps"
echo ""
echo -e "${YELLOW}# # ##### #### ###### # #### #### # # #### ####${NC}"
echo -e "${YELLOW}## # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # ##### # # # # # # #### ####${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# ## ##### #### ###### ###### #### #### #### # ####${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
echo -e "今日运行次数: ${RED}$daily_count${NC} 次,累计运行次数: ${RED}$total_count${NC}"
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "一键脚本将测试以下项目:"
echo "流媒体解锁"
echo ""
echo -e "${RED}按任意键开始测试...${NC}"
read -n 1 -s
clear
}
# 定义一个数组来存储每个命令的输出
declare -a test_results
# 在每个命令执行后保存结果
run_and_capture() {
local command_output
command_output=$(eval "$1" 2>&1)
test_results+=("$command_output")
echo "$command_output"
}
# 去除流媒体板块ANSI转义码并截取
streaming_process_output() {
local input="$1"
echo "$input" | sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g' | awk '/项目地址/{f=1} f; /检测脚本当天运行次数/{f=0}'
}
# 运行所有测试
run_all_tests() {
echo -e "${RED}开始测试,测试时间较长,请耐心等待...${NC}"
# 流媒体解锁
echo -e "运行${YELLOW}流媒体解锁测试...${NC}"
local region
region=$(detect_region)
streaming_result=$(run_and_capture "echo '$region' | bash <(curl -L -s media.ispvps.com)")
# 格式化结果
echo -e "${YELLOW}此报告由Nodeloc_VPS_自动脚本测试生成...${NC}"
format_results
}
# 格式化结果为 Markdown
format_results() {
# 处理流媒体解锁结果
local processed_streaming_result
processed_streaming_result=$(streaming_process_output "$streaming_result")
result="[tabs]
[tab=\"流媒体\"]
\`\`\`
$processed_streaming_result
\`\`\`
[/tab]
[/tabs]"
echo "$result" > results.md
echo -e "${YELLOW}结果已保存到 results.md 文件中。${NC}"
}
# 主函数
main() {
install_dependencies
show_welcome
run_all_tests
echo -e "${YELLOW}所有测试完成可到results.md复制到Nodeloc使用。${NC}"
read -n 1 -s
echo "最终测试结果如下:" >&2
cat results.md >&2
}
main

View File

@ -1,160 +0,0 @@
#!/bin/bash
# 定义版本
VERSION="1.0.0"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 检查 root 权限并获取 sudo 权限
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
# 检查并安装依赖
install_dependencies() {
echo -e "${YELLOW}正在检查并安装必要的依赖项...${NC}"
# 更新包列表
if ! sudo apt-get update; then
echo -e "${RED}无法更新包列表。请检查您的网络连接和系统设置。${NC}"
exit 1
fi
# 安装依赖
local dependencies=(
"curl"
"wget"
)
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &> /dev/null; then
echo -e "${YELLOW}正在安装 $dep...${NC}"
if ! sudo apt-get install -y "$dep"; then
echo -e "${RED}无法安装 $dep。请手动安装此依赖项。${NC}"
fi
else
echo -e "${GREEN}$dep 已安装。${NC}"
fi
done
echo -e "${GREEN}依赖项检查和安装完成。${NC}"
clear
}
# 统计使用次数
sum_run_times() {
local COUNT
COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/everett7623/nodeloc_vps_test/blob/main/nodeloc_vps_autotest.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
if [[ -n "$COUNT" ]]; then
daily_count=$(cut -d " " -f1 <<< "$COUNT")
total_count=$(cut -d " " -f3 <<< "$COUNT")
else
echo "Failed to fetch usage counts."
daily_count=0
total_count=0
fi
}
# 调用函数获取统计数据
sum_run_times
# 输出欢迎信息
show_welcome() {
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "Nodeloc_VPS_自动脚本测试 $VERSION"
echo "GitHub地址: https://github.com/everett7623/nodeloc_vps_test"
echo "VPS选购: https://www.nodeloc.com/vps"
echo ""
echo -e "${YELLOW}# # ##### #### ###### # #### #### # # #### ####${NC}"
echo -e "${YELLOW}## # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # ##### # # # # # # #### ####${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# ## ##### #### ###### ###### #### #### #### # ####${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
echo -e "今日运行次数: ${RED}$daily_count${NC} 次,累计运行次数: ${RED}$total_count${NC}"
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "一键脚本将测试以下项目:"
echo "响应测试"
echo ""
echo -e "${RED}按任意键开始测试...${NC}"
read -n 1 -s
clear
}
# 定义一个数组来存储每个命令的输出
declare -a test_results
# 在每个命令执行后保存结果
run_and_capture() {
local command_output
command_output=$(eval "$1" 2>&1)
test_results+=("$command_output")
echo "$command_output"
}
# 去除响应板块ANSI转义码
response_process_output() {
local input="$1"
echo "$input" | sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g'
}
# 运行所有测试
run_all_tests() {
echo -e "${RED}开始测试,测试时间较长,请耐心等待...${NC}"
# 响应测试
echo -e "运行${YELLOW}响应测试...${NC}"
response_result=$(run_and_capture "bash <(curl -sL https://nodebench.mereith.com/scripts/curltime.sh)")
# 格式化结果
echo -e "${YELLOW}此报告由Nodeloc_VPS_自动脚本测试生成...${NC}"
format_results
}
# 格式化结果为 Markdown
format_results() {
# 处理响应测试结果
local processed_response_result
processed_response_result=$(response_process_output "$response_result")
result="[tabs]
[tab=\"响应\"]
\`\`\`
$processed_response_result
\`\`\`
[/tab]
[/tabs]"
echo "$result" > results.md
echo -e "${YELLOW}结果已保存到 results.md 文件中。${NC}"
}
# 主函数
main() {
install_dependencies
show_welcome
run_all_tests
echo -e "${YELLOW}所有测试完成可到results.md复制到Nodeloc使用。${NC}"
read -n 1 -s
echo "最终测试结果如下:" >&2
cat results.md >&2
}
main

View File

@ -1,175 +0,0 @@
#!/bin/bash
# 定义版本
VERSION="1.0.0"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 检查 root 权限并获取 sudo 权限
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
# 检查并安装依赖
install_dependencies() {
echo -e "${YELLOW}正在检查并安装必要的依赖项...${NC}"
# 更新包列表
if ! sudo apt-get update; then
echo -e "${RED}无法更新包列表。请检查您的网络连接和系统设置。${NC}"
exit 1
fi
# 安装依赖
local dependencies=(
"curl"
"wget"
)
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &> /dev/null; then
echo -e "${YELLOW}正在安装 $dep...${NC}"
if ! sudo apt-get install -y "$dep"; then
echo -e "${RED}无法安装 $dep。请手动安装此依赖项。${NC}"
fi
else
echo -e "${GREEN}$dep 已安装。${NC}"
fi
done
echo -e "${GREEN}依赖项检查和安装完成。${NC}"
clear
}
# 统计使用次数
sum_run_times() {
local COUNT
COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/everett7623/nodeloc_vps_test/blob/main/nodeloc_vps_autotest.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
if [[ -n "$COUNT" ]]; then
daily_count=$(cut -d " " -f1 <<< "$COUNT")
total_count=$(cut -d " " -f3 <<< "$COUNT")
else
echo "Failed to fetch usage counts."
daily_count=0
total_count=0
fi
}
# 调用函数获取统计数据
sum_run_times
# 输出欢迎信息
show_welcome() {
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "Nodeloc_VPS_自动脚本测试 $VERSION"
echo "GitHub地址: https://github.com/everett7623/nodeloc_vps_test"
echo "VPS选购: https://www.nodeloc.com/vps"
echo ""
echo -e "${YELLOW}# # ##### #### ###### # #### #### # # #### ####${NC}"
echo -e "${YELLOW}## # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # ##### # # # # # # #### ####${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# ## ##### #### ###### ###### #### #### #### # ####${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
echo -e "今日运行次数: ${RED}$daily_count${NC} 次,累计运行次数: ${RED}$total_count${NC}"
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "一键脚本将测试以下项目:"
echo "多线程测试(调试中)"
echo "单线程测试(调试中)"
echo ""
echo -e "${RED}按任意键开始测试...${NC}"
read -n 1 -s
clear
}
# 定义一个数组来存储每个命令的输出
declare -a test_results
# 在每个命令执行后保存结果
run_and_capture() {
local command_output
command_output=$(eval "$1" 2>&1)
test_results+=("$command_output")
echo "$command_output"
}
# 去除三网测速板块板块ANSI转义码并截取
speedtest_process_output() {
local input="$1"
# 去除 ANSI 转义码并提取所需的测试结果
echo "$input" | sed 's/\x1B\[[0-9;]*[JKmsu]//g' | awk '
BEGIN { print_flag = 0 }
/------------------------ 多功能 自更新 测速脚本 ------------------------/ { print_flag = 1 }
print_flag && !/测试进行中/ { print }
/------------------------ 测试结束 ------------------------/ { print_flag = 0 }
'
}
# 运行所有测试
run_all_tests() {
echo -e "${RED}开始测试,测试时间较长,请耐心等待...${NC}"
# 三网测速
echo -e "运行${YELLOW}三网测速(多线程/单线程)...${NC}"
echo -e "默认选择1${YELLOW}大陆三网+教育网 IPv4多线程/单线程)测试...${NC}"
speedtest_multi_result=$(echo '1' | bash <(curl -sL bash.icu/speedtest))
speedtest_single_result=$(echo '2' | bash <(curl -sL bash.icu/speedtest))
# 格式化结果
echo -e "${YELLOW}此报告由Nodeloc_VPS_自动脚本测试生成...${NC}"
format_results
}
# 格式化结果为 Markdown
format_results() {
# 处理三网测速结果
local processed_speedtest_multi_result=$(speedtest_process_output "$speedtest_multi_result")
local processed_speedtest_single_result=$(speedtest_process_output "$speedtest_single_result")
result="[tabs]
[tab=\"多线程测速\"]
\`\`\`
$processed_speedtest_multi_result
\`\`\`
[/tab]
[tab=\"单线程测速\"]
\`\`\`
$processed_speedtest_single_result
\`\`\`
[/tab]
[/tabs]"
echo "$result" > results.md
echo -e "${YELLOW}结果已保存到 results.md 文件中。${NC}"
}
# 主函数
main() {
install_dependencies
show_welcome
run_all_tests
echo -e "${YELLOW}所有测试完成可到results.md复制到Nodeloc使用。${NC}"
read -n 1 -s -r -p "按任意键退出..."
echo "最终测试结果如下:" >&2
cat results.md >&2
}
main

View File

@ -1,159 +0,0 @@
#!/bin/bash
# 定义版本
VERSION="1.0.0"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 检查 root 权限并获取 sudo 权限
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
# 检查并安装依赖
install_dependencies() {
echo -e "${YELLOW}正在检查并安装必要的依赖项...${NC}"
# 更新包列表
if ! sudo apt-get update; then
echo -e "${RED}无法更新包列表。请检查您的网络连接和系统设置。${NC}"
exit 1
fi
# 安装依赖
local dependencies=(
"curl"
"wget"
)
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &> /dev/null; then
echo -e "${YELLOW}正在安装 $dep...${NC}"
if ! sudo apt-get install -y "$dep"; then
echo -e "${RED}无法安装 $dep。请手动安装此依赖项。${NC}"
fi
else
echo -e "${GREEN}$dep 已安装。${NC}"
fi
done
echo -e "${GREEN}依赖项检查和安装完成。${NC}"
clear
}
# 统计使用次数
sum_run_times() {
local COUNT
COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/everett7623/nodeloc_vps_test/blob/main/nodeloc_vps_autotest.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
if [[ -n "$COUNT" ]]; then
daily_count=$(cut -d " " -f1 <<< "$COUNT")
total_count=$(cut -d " " -f3 <<< "$COUNT")
else
echo "Failed to fetch usage counts."
daily_count=0
total_count=0
fi
}
# 调用函数获取统计数据
sum_run_times
# 输出欢迎信息
show_welcome() {
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "Nodeloc_VPS_自动脚本测试 $VERSION"
echo "GitHub地址: https://github.com/everett7623/nodeloc_vps_test"
echo "VPS选购: https://www.nodeloc.com/vps"
echo ""
echo -e "${YELLOW}# # ##### #### ###### # #### #### # # #### ####${NC}"
echo -e "${YELLOW}## # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # ##### # # # # # # #### ####${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# ## ##### #### ###### ###### #### #### #### # ####${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
echo -e "今日运行次数: ${RED}$daily_count${NC} 次,累计运行次数: ${RED}$total_count${NC}"
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "一键脚本将测试以下项目:"
echo "回程路由"
echo ""
echo -e "${RED}按任意键开始测试...${NC}"
read -n 1 -s
clear
}
# 定义一个数组来存储每个命令的输出
declare -a test_results
# 在每个命令执行后保存结果
run_and_capture() {
local command_output
command_output=$(eval "$1" 2>&1)
test_results+=("$command_output")
echo "$command_output"
}
# 去除回程路由板块板块ANSI转义码并截取
autotrace_process_output() {
local input="$1"
# 使用更全面的 sed 命令去除所有 ANSI 转义码
echo "$input" | sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g' | awk '/No:1\/9 Traceroute to 中国/{f=1} f; /\[信息\] 已删除 Nexttrace 文件/{f=0}'
# 运行所有测试
run_all_tests() {
echo -e "${RED}开始测试,测试时间较长,请耐心等待...${NC}"
# AutoTrace三网回程路由
echo -e "运行${YELLOW}AutoTrace三网回程路由...${NC}"
autotrace_result=$(run_and_capture "wget -N --no-check-certificate https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && echo '1' | bash AutoTrace.sh")
# 格式化结果
echo -e "${YELLOW}此报告由Nodeloc_VPS_自动脚本测试生成...${NC}"
format_results
}
# 格式化结果为 Markdown
format_results() {
# 处理回程路由结果
local processed_autotrace_result=$(autotrace_process_output "$autotrace_result")
result="[tabs]
[tab=\"回程路由\"]
\`\`\`
$processed_autotrace_result
\`\`\`
[/tab]
[/tabs]"
echo "$result" > results.md
echo -e "${YELLOW}结果已保存到 results.md 文件中。${NC}"
}
# 主函数
main() {
install_dependencies
show_welcome
run_all_tests
echo -e "${YELLOW}所有测试完成可到results.md复制到Nodeloc使用。${NC}"
read -n 1 -s
echo "最终测试结果如下:" >&2
cat results.md >&2
}
main

View File

@ -1,153 +0,0 @@
#!/bin/bash
# 定义版本
VERSION="1.0.0"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 检查 root 权限并获取 sudo 权限
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
if ! sudo -v; then
echo "无法获取 sudo 权限,退出脚本。"
exit 1
fi
echo "已获取 sudo 权限。"
fi
# 检查并安装依赖
install_dependencies() {
echo -e "${YELLOW}正在检查并安装必要的依赖项...${NC}"
# 更新包列表
if ! sudo apt-get update; then
echo -e "${RED}无法更新包列表。请检查您的网络连接和系统设置。${NC}"
exit 1
fi
# 安装依赖
local dependencies=(
"curl"
"wget"
)
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &> /dev/null; then
echo -e "${YELLOW}正在安装 $dep...${NC}"
if ! sudo apt-get install -y "$dep"; then
echo -e "${RED}无法安装 $dep。请手动安装此依赖项。${NC}"
fi
else
echo -e "${GREEN}$dep 已安装。${NC}"
fi
done
echo -e "${GREEN}依赖项检查和安装完成。${NC}"
clear
}
# 统计使用次数
sum_run_times() {
local COUNT
COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/everett7623/nodeloc_vps_test/blob/main/nodeloc_vps_autotest.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
if [[ -n "$COUNT" ]]; then
daily_count=$(cut -d " " -f1 <<< "$COUNT")
total_count=$(cut -d " " -f3 <<< "$COUNT")
else
echo "Failed to fetch usage counts."
daily_count=0
total_count=0
fi
}
# 调用函数获取统计数据
sum_run_times
# 输出欢迎信息
show_welcome() {
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "Nodeloc_VPS_自动脚本测试 $VERSION"
echo "GitHub地址: https://github.com/everett7623/nodeloc_vps_test"
echo "VPS选购: https://www.nodeloc.com/vps"
echo ""
echo -e "${YELLOW}# # ##### #### ###### # #### #### # # #### ####${NC}"
echo -e "${YELLOW}## # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # ##### # # # # # # #### ####${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# # # # # # # # # # # # # # # # # #${NC}"
echo -e "${YELLOW}# ## ##### #### ###### ###### #### #### #### # ####${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
echo -e "今日运行次数: ${RED}$daily_count${NC} 次,累计运行次数: ${RED}$total_count${NC}"
echo ""
echo -e "${RED}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "脚本将测试以下项目:"
echo "Yabs"
echo ""
echo -e "${RED}按任意键开始测试...${NC}"
read -n 1 -s
clear
}
# 定义一个数组来存储每个命令的输出
declare -a test_results
# 运行所有测试
run_all_tests() {
echo -e "${RED}开始测试,测试时间较长,请耐心等待...${NC}"
echo -e "运行${YELLOW}YABS...${NC}"
# 使用 script 命令运行 YABS 并捕获输出
script -q -c "wget -qO- yabs.sh | bash" /dev/null | tee /tmp/yabs_output
# 从输出中移除最后一行(通常是 "按回车键返回主菜单..."
sed '$d' /tmp/yabs_output > /tmp/yabs_final_output
# 读取处理后的输出
yabs_result=$(cat /tmp/yabs_final_output)
# 删除临时文件
rm /tmp/yabs_output /tmp/yabs_final_output
# 格式化结果
format_results
}
# 格式化结果为 Markdown
format_results() {
local processed_yabs_result=$(echo "$yabs_result" | sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g')
result="[tabs]
[tab=\"YABS\"]
\`\`\`
$processed_yabs_result
\`\`\`
[/tab]
[/tabs]"
echo "$result" > results.md
echo -e "${YELLOW}结果已保存到 results.md 文件中。${NC}"
}
# 主函数
main() {
install_dependencies
show_welcome
run_all_tests
echo -e "${YELLOW}所有测试完成可到results.md复制到Nodeloc使用。${NC}"
read -n 1 -s
echo "最终测试结果如下:" >&2
cat results.md >&2
}
main

494
server/bench.html Normal file
View File

@ -0,0 +1,494 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>测试结果页面</title>
</head>
<body>
<div class="loading">
正在加载文件
</div>
<div class="tabs"></div>
<button class="copy-btn" data-clipboard-target="#copy-target">
复制论坛代码/Copy BBCode
</button>
<textarea id="copy-target"></textarea>
<style>
html {
--body-bg: #fff;
--muted-color: #546e7a;
--border-radius: 5px;
--primary-color: #0d47a1;
--control-bg: #bbdefb;
}
html,
body {
height: 100%;
width: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
.copy-btn {
padding: 7px;
border-radius: var(--border-radius);
background: #0d47a1;
color: #fff;
vertical-align: bottom;
outline: 0;
border: unset;
box-shadow: 1px 1px 2px black;
cursor: pointer;
position: fixed;
left: 5px;
bottom: 5px;
}
.copy-btn:active {
box-shadow: 1px 1px 2px black inset;
}
#copy-target {
margin-top: 50px;
z-index: -1;
display: none;
}
.loading,
.error {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 100px;
text-align: center;
font-size: large;
z-index: 999;
}
.error {
background-color: #ffcdd2;
}
.loading {
background-color: #e3f2fd;
}
</style>
<style>
.tabs {
position: relative;
clear: both;
padding-top: 44px;
white-space: nowrap;
overflow: auto;
height: 28px;
max-width: 1000px;
margin: 0 auto;
}
.tabs .tab {
display: inline-block;
}
.tabs .tab:first-of-type label {
border-top-left-radius: var(--border-radius);
}
.tabs .tab:last-of-type label {
border-top-right-radius: var(--border-radius);
}
.tabs .tab label {
background: var(--body-bg);
padding: 10px 10px 7px;
border: 1px solid var(--muted-color);
margin-left: -1px;
position: relative;
left: 1px;
}
.tabs .tab [type="radio"] {
display: none;
}
.tabs .content-tab {
display: none;
position: fixed;
top: 72px;
left: 0;
background: var(--body-bg);
right: 0;
bottom: 100px;
padding: 10px 20px;
border: 1px solid var(--muted-color);
border-radius: 0 var(--border-radius) var(--border-radius)
var(--border-radius);
overflow-y: auto;
max-width: 1000px;
margin: 0 auto;
}
.tabs [type="radio"]:checked ~ label {
background: var(--control-bg);
border-bottom: 3px solid var(--primary-color);
}
.tabs [type="radio"]:checked ~ label ~ .content-tab {
display: block;
}
</style>
<script src="https://fastly.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://fastly.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script>
<script>
function getFilePath(fileName) {
// 从 URL 中提取路径部分
const urlSegments = location.pathname.split('/');
// 动态获取年份和月份
const year = urlSegments[2]; // 第二部分为年份
const month = urlSegments[3]; // 第三部分为月份
// 构造文件路径
return `/${year}/${month}/${fileName}`;
}
const fileNameMatch =
new URLSearchParams(window.location.search).get("filename") ||
location.pathname.split("/").pop();
if (fileNameMatch) {
const fileName = decodeURIComponent(fileNameMatch);
const filePath = getFilePath(fileName);
console.log(filePath);
$.ajax({
url: filePath,
success: render
});
}
function render(data) {
$("#copy-target").val(data);
$(".loading").remove();
$(".tabs").append(
$("<div>")
.addClass("tab")
.append(
$("<input>")
.attr("type", "radio")
.attr("id", `taball`)
.attr("name", "tabs")
.attr("checked", "checked")
)
.append($("<label>").attr("for", `taball`).text("全部/All"))
.append(
$("<div>")
.addClass("content-tab")
.append(
$("<code>")
.addClass("language-bbcode")
.append($("<pre>").text(data))
)
)
);
const tags = Array.from(
data.matchAll(/\[TAB=([^\]]*)\]([^]*?)\[\/tab\]/gi)
);
tags.forEach((tagMatching, i) => {
if (tagMatching[1] && tagMatching[2]) {
const tab = $("<div>")
.addClass("tab")
.append(
$("<input>")
.attr("type", "radio")
.attr("id", `tab-${i}`)
.attr("name", "tabs")
)
.append(
$("<label>").attr("for", `tab-${i}`).text(tagMatching[1])
);
const codeContentMatching = /```([^\s]*?)([^]*)```/.exec(
tagMatching[2]
);
const contentEl = $("<div>").addClass("content-tab");
if (codeContentMatching) {
const code = $("<code>").append(
$("<pre>").text(codeContentMatching[2])
);
if (codeContentMatching[1]) {
contentEl.addClass("language-" + codeContentMatching[1]);
}
contentEl.append(code);
} else {
contentEl.text(tagMatching[2]);
}
tab.append(contentEl);
$(".tabs").append(tab);
}
});
hljs.highlightAll();
new ClipboardJS(".copy-btn");
}
function fail() {
$(".loading").attr("class", "error").text("无法加载数据文件请检查URL");
}
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>测试结果页面</title>
</head>
<body>
<div class="loading">
正在加载文件
</div>
<div class="tabs"></div>
<div class="footer">
<button class="copy-btn" data-clipboard-target="#copy-target">
复制代码 / Copy
</button>
<button class="link-btn" id="visit-forum">
访问论坛 / Visit forum
</button>
</div>
<textarea id="copy-target"></textarea>
<style>
html {
--body-bg: #fff;
--muted-color: #546e7a;
--border-radius: 5px;
--primary-color: #0d47a1;
--control-bg: #bbdefb;
}
html,
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
background: url('https://s.rmimg.com/2025/01/21/b5af503d48d3cacdddd5089dabe4a76c.jpg') no-repeat center center fixed;
background-size: cover;
font-family: Arial, sans-serif;
overflow: hidden;
}
.copy-btn {
padding: 7px;
border-radius: var(--border-radius);
background: #0d47a1;
color: #fff;
vertical-align: bottom;
outline: 0;
border: unset;
box-shadow: 1px 1px 2px black;
cursor: pointer;
}
.link-btn {
padding: 7px;
border-radius: var(--border-radius);
background: #0da148;
color: #fff;
vertical-align: bottom;
outline: 0;
border: unset;
box-shadow: 1px 1px 2px black;
cursor: pointer;
}
.copy-btn:active {
box-shadow: 1px 1px 2px black inset;
}
#copy-target {
margin-top: 50px;
z-index: -1;
width: 0px;
height: 0px;
}
.loading,
.error {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 100px;
text-align: center;
font-size: large;
z-index: 999;
}
.error {
background-color: #ffcdd2;
}
.loading {
background-color: #e3f2fd;
}
</style>
<style>
.footer{
position: fixed;
bottom: 50px;
width: 1000px;
max-width: 100%;
left: 50%;
transform: translateX(-50%);
clear: both;
}
.tabs {
position: relative;
clear: both;
padding-top: 44px;
white-space: nowrap;
height: 28px;
max-width: 1041px;
margin: 0 auto;
}
.tabs .tab {
display: inline-block;
}
.tabs .tab:first-of-type label {
border-top-left-radius: var(--border-radius);
}
.tabs .tab:last-of-type label {
border-top-right-radius: var(--border-radius);
}
.tabs .tab label {
background: var(--body-bg);
padding: 10px 10px 7px;
border: 1px solid var(--muted-color);
margin-left: -1px;
position: relative;
left: 1px;
opacity: 68%;
}
.tabs .tab [type="radio"] {
display: none;
}
.tabs .content-tab {
display: none;
position: fixed;
top: 72px;
left: 0;
background: #000;
right: 0;
color: #fff;
bottom: 100px;
padding: 10px 20px;
border: 1px solid var(--muted-color);
border-radius: 0 var(--border-radius) var(--border-radius)
var(--border-radius);
overflow-y: auto;
max-width: 1000px;
margin: 0 auto;
opacity: 0.68;
}
.tabs [type="radio"]:checked ~ label {
background: var(--control-bg);
border-bottom: 3px solid var(--primary-color);
}
.tabs [type="radio"]:checked ~ label ~ .content-tab {
display: block;
}
</style>
<script src="https://fastly.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://fastly.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script>
<script>
document.getElementById('visit-forum').addEventListener('click', function () {
window.location.href = "https://www.nodeloc.com";
});
function getFilePath(fileName) {
// 从 URL 中提取路径部分
const urlSegments = location.pathname.split('/');
// 动态获取年份和月份
const year = urlSegments[2]; // 第二部分为年份
const month = urlSegments[3]; // 第三部分为月份
// 构造文件路径
return `/${year}/${month}/${fileName}`;
}
const fileNameMatch =
new URLSearchParams(window.location.search).get("filename") ||
location.pathname.split("/").pop();
if (fileNameMatch) {
const fileName = decodeURIComponent(fileNameMatch);
const filePath = getFilePath(fileName);
console.log(filePath);
$.ajax({
url: filePath,
success: render
});
}
function render(data) {
$("#copy-target").val(data);
$(".loading").remove();
$(".tabs").append(
$("<div>")
.addClass("tab")
.append(
$("<input>")
.attr("type", "radio")
.attr("id", `taball`)
.attr("name", "tabs")
.attr("checked", "checked")
)
.append($("<label>").attr("for", `taball`).text("全部/All"))
.append(
$("<div>")
.addClass("content-tab")
.append(
$("<code>")
.addClass("language-bbcode")
.append($("<pre>").text(data))
)
)
);
const tags = Array.from(
data.matchAll(/\[TAB=([^\]]*)\]([^]*?)\[\/tab\]/gi)
);
tags.forEach((tagMatching, i) => {
if (tagMatching[1] && tagMatching[2]) {
const tab = $("<div>")
.addClass("tab")
.append(
$("<input>")
.attr("type", "radio")
.attr("id", `tab-${i}`)
.attr("name", "tabs")
)
.append(
$("<label>").attr("for", `tab-${i}`).text(tagMatching[1].replace(/"/g, ""))
);
const codeContentMatching = /```([^\s]*?)([^]*)```/.exec(
tagMatching[2]
);
const contentEl = $("<div>").addClass("content-tab");
if (codeContentMatching) {
const code = $("<code>").append(
$("<pre>").text(codeContentMatching[2])
);
if (codeContentMatching[1]) {
contentEl.addClass("language-" + codeContentMatching[1]);
}
contentEl.append(code);
} else {
contentEl.text(tagMatching[2]);
}
tab.append(contentEl);
$(".tabs").append(tab);
}
});
hljs.highlightAll();
new ClipboardJS(".copy-btn");
}
function fail() {
$(".loading").attr("class", "error").text("无法加载数据文件请检查URL");
}
</script>
</body>
</html>

61
server/index.php Normal file
View File

@ -0,0 +1,61 @@
<?php
function getHttpType(): string
{
return ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')
|| (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https'))
? 'https://' : 'http://';
}
// 检查是否有上传内容
$uploadData = file_get_contents('php://input');
if ($uploadData === false || empty($uploadData)) {
http_response_code(404);
die("Error 404: No data uploaded or invalid request.");
}
// 限制文件大小为 5MB
if (strlen($uploadData) > 5242880) {
http_response_code(500);
die("Error 500: File is too large. Maximum file size is 5MB.");
}
// 验证上传的文件是否为 txt 格式
$fileType = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $uploadData);
if ($fileType !== 'text/plain') {
http_response_code(500);
die("Error 500: Only plain text files (.txt) are allowed.");
}
// 清理控制字符
$uploadData = str_ireplace("\033[?25h", "", $uploadData);
// 获取当前年份和月份
$year = date('Y');
$month = date('m');
// 构造存储目录
$basePath = __DIR__ . "/";
$directory = $basePath . $year . "/" . $month . "/";
// 创建目录(如果不存在)
if (!is_dir($directory) && !mkdir($directory, 0755, true)) {
http_response_code(500);
die("Error 500: Failed to create directory.");
}
// 生成唯一文件名
$fileName = "NL" . time() . "-" . strtoupper(substr(md5($uploadData), 0, 6)) . ".txt";
// 构造文件 URL
$baseUrl = rtrim(getHttpType() . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']), '/'); // 去掉末尾多余的斜杠
$filePath = $directory . $fileName;
// 保存文件
if (file_put_contents($filePath, $uploadData) === false) {
http_response_code(500);
die("Error 500: Failed to save the file.");
}
// 返回文件 URL
echo $baseUrl . "/$year/$month/" . $fileName;

26
version.sh Normal file
View File

@ -0,0 +1,26 @@
# version.sh
# Version history
# 2024-07-05 v1.0.0 - 初始化版本,包含基础功能和菜单选择,一键测试或者手动多选测试。
# 2024-07-05 v1.0.1 - 修复bug回程路由ipv6测试占不支持。
# 2024-07-05 v1.0.2 - 修复若干bug。
# 2024-07-05 v1.0.3 - 修复若干bug精简代码。
# 2024-07-18 v1.0.4 - 去除yabs的iperf3和gb6单独增加gb5测试优化更新脚本代码。
# 2024-07-18 v1.0.5 - 增加自动更新脚本。
# 2024-07-19 v1.0.6 - 优化更新脚本。
# 2024-07-21 v1.0.7 - 修复bug。
# 2024-07-21 v1.0.7 - 修复bug。
# 2024-07-21 v1.0.8 - 去除yabs的gb5
# 2024-07-29 v1.0.9 - 增加依赖安装
# 2024-07-31 v1.1.0 - 去除yabs的gb6测试替换iperf3服务端vps
# 2024-08-08 v1.1.1 - 去除回程路由的ip等信息。
# 2024-08-13 v1.1.2 - 优化tab标签。
# 2024-08-19 v1.1.3 - 优化系统更新代码。
# 2024-08-28 v1.1.4 - 优化系统更新代码。
# 2024-09-07 v1.2.0 - 优化代码。
# 2024-09-07 v1.2.1 - 优化代码。
# 2024-09-07 v1.2.2 - 优化代码。
# 2024-09-08 v1.2.4 - 兼容新的接口。
# 2024-09-21 v1.2.5 - 修改bug。
# 2024-09-21 v1.2.6 - 删除融合怪。
# 2025-01-21 v1.2.7 - 改用Curl命令优化国内连接