Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed Jul 3, 2024
1 parent e9680e9 commit b6b47c3
Show file tree
Hide file tree
Showing 723 changed files with 97 additions and 243,252 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# pingtest

[![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)
国内测速节点三网测ping模块

三网ICMP的ping值测试模块

## 说明

Expand Down Expand Up @@ -45,8 +46,8 @@ pt
## 卸载

```
rm -rf /root/spt
rm -rf /usr/bin/spt
rm -rf /root/pt
rm -rf /usr/bin/pt
```

## 在Golang中使用
Expand Down
93 changes: 93 additions & 0 deletions pt_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/bin/bash
#From https://github.com/oneclickvirt/pingtest
#2024.06.29

rm -rf /usr/bin/pt
rm -rf pt
os=$(uname -s)
arch=$(uname -m)

check_cdn() {
local o_url=$1
for cdn_url in "${cdn_urls[@]}"; do
if curl -sL -k "$cdn_url$o_url" --max-time 6 | grep -q "success" >/dev/null 2>&1; then
export cdn_success_url="$cdn_url"
return
fi
sleep 0.5
done
export cdn_success_url=""
}

check_cdn_file() {
check_cdn "https://raw.githubusercontent.com/spiritLHLS/ecs/main/back/test"
if [ -n "$cdn_success_url" ]; then
echo "CDN available, using CDN"
else
echo "No CDN available, no use CDN"
fi
}

cdn_urls=("https://cdn0.spiritlhl.top/" "http://cdn3.spiritlhl.net/" "http://cdn1.spiritlhl.net/" "http://cdn2.spiritlhl.net/")
check_cdn_file

case $os in
Linux)
case $arch in
"x86_64" | "x86" | "amd64" | "x64")
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-linux-amd64"
;;
"i386" | "i686")
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-linux-386"
;;
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-linux-arm64"
;;
*)
echo "Unsupported architecture: $arch"
exit 1
;;
esac
;;
Darwin)
case $arch in
"x86_64" | "x86" | "amd64" | "x64")
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-darwin-amd64"
;;
"i386" | "i686")
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-darwin-386"
;;
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-darwin-arm64"
;;
*)
echo "Unsupported architecture: $arch"
exit 1
;;
esac
;;
FreeBSD)
case $arch in
amd64)
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-freebsd-amd64"
;;
"i386" | "i686")
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-freebsd-386"
;;
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
wget -O pt "${cdn_success_url}https://github.com/oneclickvirt/pingtest/releases/download/output/pingtest-freebsd-arm64"
;;
*)
echo "Unsupported architecture: $arch"
exit 1
;;
esac
;;
*)
echo "Unsupported operating system: $os"
exit 1
;;
esac

chmod 777 pt
cp pt /usr/bin/pt
41 changes: 0 additions & 41 deletions vendor/github.com/google/uuid/CHANGELOG.md

This file was deleted.

26 changes: 0 additions & 26 deletions vendor/github.com/google/uuid/CONTRIBUTING.md

This file was deleted.

9 changes: 0 additions & 9 deletions vendor/github.com/google/uuid/CONTRIBUTORS

This file was deleted.

27 changes: 0 additions & 27 deletions vendor/github.com/google/uuid/LICENSE

This file was deleted.

21 changes: 0 additions & 21 deletions vendor/github.com/google/uuid/README.md

This file was deleted.

80 changes: 0 additions & 80 deletions vendor/github.com/google/uuid/dce.go

This file was deleted.

12 changes: 0 additions & 12 deletions vendor/github.com/google/uuid/doc.go

This file was deleted.

59 changes: 0 additions & 59 deletions vendor/github.com/google/uuid/hash.go

This file was deleted.

Loading

0 comments on commit b6b47c3

Please sign in to comment.