Skip to content

Commit b6b47c3

Browse files
committed
update
1 parent e9680e9 commit b6b47c3

File tree

723 files changed

+97
-243252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

723 files changed

+97
-243252
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# pingtest
22

33
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Foneclickvirt%2Fpingtest&count_bg=%232EFFF8&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://www.spiritlhl.net)
4-
国内测速节点三网测ping模块
4+
5+
三网ICMP的ping值测试模块
56

67
## 说明
78

@@ -45,8 +46,8 @@ pt
4546
## 卸载
4647

4748
```
48-
rm -rf /root/spt
49-
rm -rf /usr/bin/spt
49+
rm -rf /root/pt
50+
rm -rf /usr/bin/pt
5051
```
5152

5253
## 在Golang中使用

pt_install.sh

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/bin/bash
2+
#From https://github.com/oneclickvirt/pingtest
3+
#2024.06.29
4+
5+
rm -rf /usr/bin/pt
6+
rm -rf pt
7+
os=$(uname -s)
8+
arch=$(uname -m)
9+
10+
check_cdn() {
11+
local o_url=$1
12+
for cdn_url in "${cdn_urls[@]}"; do
13+
if curl -sL -k "$cdn_url$o_url" --max-time 6 | grep -q "success" >/dev/null 2>&1; then
14+
export cdn_success_url="$cdn_url"
15+
return
16+
fi
17+
sleep 0.5
18+
done
19+
export cdn_success_url=""
20+
}
21+
22+
check_cdn_file() {
23+
check_cdn "https://raw.githubusercontent.com/spiritLHLS/ecs/main/back/test"
24+
if [ -n "$cdn_success_url" ]; then
25+
echo "CDN available, using CDN"
26+
else
27+
echo "No CDN available, no use CDN"
28+
fi
29+
}
30+
31+
cdn_urls=("https://cdn0.spiritlhl.top/" "http://cdn3.spiritlhl.net/" "http://cdn1.spiritlhl.net/" "http://cdn2.spiritlhl.net/")
32+
check_cdn_file
33+
34+
case $os in
35+
Linux)
36+
case $arch in
37+
"x86_64" | "x86" | "amd64" | "x64")
38+
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-linux-amd64"
39+
;;
40+
"i386" | "i686")
41+
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-linux-386"
42+
;;
43+
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
44+
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-linux-arm64"
45+
;;
46+
*)
47+
echo "Unsupported architecture: $arch"
48+
exit 1
49+
;;
50+
esac
51+
;;
52+
Darwin)
53+
case $arch in
54+
"x86_64" | "x86" | "amd64" | "x64")
55+
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-darwin-amd64"
56+
;;
57+
"i386" | "i686")
58+
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-darwin-386"
59+
;;
60+
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
61+
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-darwin-arm64"
62+
;;
63+
*)
64+
echo "Unsupported architecture: $arch"
65+
exit 1
66+
;;
67+
esac
68+
;;
69+
FreeBSD)
70+
case $arch in
71+
amd64)
72+
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-freebsd-amd64"
73+
;;
74+
"i386" | "i686")
75+
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-freebsd-386"
76+
;;
77+
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
78+
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-freebsd-arm64"
79+
;;
80+
*)
81+
echo "Unsupported architecture: $arch"
82+
exit 1
83+
;;
84+
esac
85+
;;
86+
*)
87+
echo "Unsupported operating system: $os"
88+
exit 1
89+
;;
90+
esac
91+
92+
chmod 777 pt
93+
cp pt /usr/bin/pt

vendor/github.com/google/uuid/CHANGELOG.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

vendor/github.com/google/uuid/CONTRIBUTING.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

vendor/github.com/google/uuid/CONTRIBUTORS

Lines changed: 0 additions & 9 deletions
This file was deleted.

vendor/github.com/google/uuid/LICENSE

Lines changed: 0 additions & 27 deletions
This file was deleted.

vendor/github.com/google/uuid/README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

vendor/github.com/google/uuid/dce.go

Lines changed: 0 additions & 80 deletions
This file was deleted.

vendor/github.com/google/uuid/doc.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

vendor/github.com/google/uuid/hash.go

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)