mirror of
				https://github.com/oneclickvirt/ecs.git
				synced 2025-11-01 03:12:44 +08:00 
			
		
		
		
	Compare commits
	
		
			58 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 93fd68bf82 | ||
|   | 793c44163a | ||
|   | b403d71115 | ||
|   | e4e11dd132 | ||
|   | 1c876f5199 | ||
| ![github-actions[bot]](/assets/img/avatar_default.png)  | fb9ae4d0e0 | ||
|   | 57e87348d4 | ||
|   | d40bf5a195 | ||
|   | 753738931d | ||
|   | a702c5416a | ||
| ![github-actions[bot]](/assets/img/avatar_default.png)  | a587d71348 | ||
|   | 110e6d34f9 | ||
|   | 4d18497dd3 | ||
|   | c676cd83cb | ||
|   | 58e1de4487 | ||
|   | 89eecd2acc | ||
|   | 194dee49fd | ||
|   | 1e88513b8e | ||
|   | f84023d18b | ||
| ![github-actions[bot]](/assets/img/avatar_default.png)  | 2cfd5af3c0 | ||
|   | ed66e2804a | ||
|   | 174bf303af | ||
|   | b75f42ffe5 | ||
| ![github-actions[bot]](/assets/img/avatar_default.png)  | 56b71ac53f | ||
|   | 1045d3fab8 | ||
| ![github-actions[bot]](/assets/img/avatar_default.png)  | 7bd2b59d58 | ||
|   | cc1da7ea7c | ||
| ![github-actions[bot]](/assets/img/avatar_default.png)  | 1a002a1681 | ||
|   | ee2b55e7eb | ||
|   | a55cebf94b | ||
|   | 0571a8df13 | ||
|   | f29a2829f3 | ||
|   | 33b8e0396f | ||
|   | c259073d1b | ||
|   | 07ebc8cab5 | ||
|   | 1824051e53 | ||
|   | 9f93a2e59d | ||
|   | 8cd09182da | ||
|   | 9bb776d411 | ||
|   | 12f2da9da2 | ||
| ![github-actions[bot]](/assets/img/avatar_default.png)  | 7aa70ac1fd | ||
|   | 04ce926582 | ||
|   | 73eb38eed1 | ||
|   | 9bc8a934b1 | ||
|   | 7b729e073b | ||
|   | 111126ae90 | ||
|   | 9397f789be | ||
|   | 5a1dda6483 | ||
|   | e322c717c0 | ||
|   | 778b33142b | ||
|   | aa9f361380 | ||
| ![github-actions[bot]](/assets/img/avatar_default.png)  | 3236c60359 | ||
|   | 73b0f30ddc | ||
|   | 825da78bd5 | ||
|   | 5d2f3c7f96 | ||
|   | 61247a206e | ||
|   | f0daad1360 | ||
| ![github-actions[bot]](/assets/img/avatar_default.png)  | 2d23fb55a0 | 
							
								
								
									
										14
									
								
								.back/OldFunction.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								.back/OldFunction.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| // clearScreen 清屏 | ||||
| func clearScreen() { | ||||
| 	var cmd *exec.Cmd | ||||
| 	switch runtime.GOOS { | ||||
| 	case "windows": | ||||
| 		cmd = exec.Command("cmd", "/c", "cls") | ||||
| 	case "darwin": | ||||
| 		cmd = exec.Command("clear") | ||||
| 	default: | ||||
| 		cmd = exec.Command("clear") | ||||
| 	} | ||||
| 	cmd.Stdout = os.Stdout | ||||
| 	_ = cmd.Run() | ||||
| } | ||||
| @@ -1,9 +0,0 @@ | ||||
| package backtrace | ||||
|  | ||||
| import ( | ||||
| 	"github.com/oneclickvirt/backtrace/bk" | ||||
| ) | ||||
|  | ||||
| func BackTrace(enableIpv6 bool) { | ||||
| 	backtrace.BackTrace(enableIpv6) | ||||
| } | ||||
| @@ -1,21 +0,0 @@ | ||||
| package backtrace | ||||
|  | ||||
| import ( | ||||
| 	"testing" | ||||
| ) | ||||
|  | ||||
| //func TestGeneratePrefixMap(t *testing.T) { | ||||
| //	prefix := "223.119.8.0/21" | ||||
| //	prefixList := GeneratePrefixList(prefix) | ||||
| //	if prefixList != nil { | ||||
| //		// 打印生成的IP地址前缀列表 | ||||
| //		for _, ip := range prefixList { | ||||
| //			fmt.Println(ip) | ||||
| //		} | ||||
| //	} | ||||
| //} | ||||
|  | ||||
| // 本包仅测试,无实际使用 | ||||
| func TestBackTrace(t *testing.T) { | ||||
| 	BackTrace(false) | ||||
| } | ||||
| @@ -235,7 +235,7 @@ jobs: | ||||
|       - name: Set up Go | ||||
|         uses: actions/setup-go@v5 | ||||
|         with: | ||||
|           go-version: 1.24.5 | ||||
|           go-version: 1.25.3 | ||||
| 
 | ||||
|       - name: Configure Git for Private Modules | ||||
|         run: | | ||||
| @@ -283,7 +283,7 @@ jobs: | ||||
|       - name: Set up Go | ||||
|         uses: actions/setup-go@v5 | ||||
|         with: | ||||
|           go-version: 1.24.5 | ||||
|           go-version: 1.25.3 | ||||
| 
 | ||||
|       - name: Configure Git for Private Modules | ||||
|         run: | | ||||
| @@ -1,9 +0,0 @@ | ||||
| package ntrace | ||||
|  | ||||
| import ( | ||||
| 	"github.com/oneclickvirt/nt3/nt" | ||||
| ) | ||||
|  | ||||
| func TraceRoute3(language, location, checkType string) { | ||||
| 	nt.TraceRoute(language, location, checkType) | ||||
| } | ||||
| @@ -1,9 +0,0 @@ | ||||
| package ntrace | ||||
|  | ||||
| import "testing" | ||||
|  | ||||
| // https://github.com/nxtrace/NTrace-core/blob/main/fast_trace/fast_trace.go | ||||
| // 本包仅测试无实际使用 | ||||
| func TestTraceRoute(t *testing.T) { | ||||
| 	TraceRoute3("en", "GZ", "ipv4") | ||||
| } | ||||
							
								
								
									
										2
									
								
								.github/workflows/build_binary.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/build_binary.yaml
									
									
									
									
										vendored
									
									
								
							| @@ -22,7 +22,7 @@ jobs: | ||||
|       - name: Set up Go | ||||
|         uses: actions/setup-go@v4 | ||||
|         with: | ||||
|           go-version: 1.24.5 | ||||
|           go-version: 1.25.3 | ||||
|  | ||||
|       - name: Configure Git for Private Modules | ||||
|         run: | | ||||
|   | ||||
							
								
								
									
										19
									
								
								.github/workflows/build_docker.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										19
									
								
								.github/workflows/build_docker.yaml
									
									
									
									
										vendored
									
									
								
							| @@ -1,33 +1,30 @@ | ||||
| name: Build and Push Docker Image | ||||
|  | ||||
| on: | ||||
|   workflow_run: | ||||
|     workflows: ["Build and Release"] | ||||
|     types: | ||||
|       - completed | ||||
|   workflow_dispatch: | ||||
|  | ||||
| jobs: | ||||
|   build: | ||||
|     runs-on: ubuntu-latest | ||||
|     permissions: | ||||
|       contents: read | ||||
|       packages: write | ||||
|     steps: | ||||
|       - name: Checkout repository | ||||
|         uses: actions/checkout@v2 | ||||
|  | ||||
|       - name: Set up QEMU | ||||
|         uses: docker/setup-qemu-action@v2 | ||||
|         with: | ||||
|           platforms: all | ||||
|  | ||||
|       - name: Set up Docker Buildx | ||||
|         uses: docker/setup-buildx-action@v2 | ||||
|  | ||||
|       - name: Log in to Docker Hub | ||||
|         uses: docker/login-action@v2 | ||||
|         with: | ||||
|           username: ${{ secrets.DOCKER_USERNAME }} | ||||
|           password: ${{ secrets.DOCKER_PASSWORD }} | ||||
|  | ||||
|       # - name: Login to CNB Registry | ||||
|       #   uses: docker/login-action@v2 | ||||
|       #   with: | ||||
| @@ -41,7 +38,14 @@ jobs: | ||||
|           registry: crpi-8tmognxgyb86bm61.cn-guangzhou.personal.cr.aliyuncs.com | ||||
|           username: ${{ secrets.ALIYUN_USERNAME }} | ||||
|           password: ${{ secrets.ALIYUN_PASSWORD }} | ||||
|  | ||||
|        | ||||
|       - name: Log in to GitHub Container Registry | ||||
|         uses: docker/login-action@v2 | ||||
|         with: | ||||
|           registry: ghcr.io | ||||
|           username: ${{ github.actor }} | ||||
|           password: ${{ secrets.GITHUB_TOKEN }} | ||||
|        | ||||
|       - name: Build and push Docker images | ||||
|         uses: docker/build-push-action@v4 | ||||
|         with: | ||||
| @@ -54,3 +58,4 @@ jobs: | ||||
|           tags: | | ||||
|             ${{ secrets.DOCKER_USERNAME }}/goecs:latest | ||||
|             crpi-8tmognxgyb86bm61.cn-guangzhou.personal.cr.aliyuncs.com/oneclickvirt/ecs:latest | ||||
|             ghcr.io/${{ github.repository_owner }}/goecs:latest | ||||
|   | ||||
							
								
								
									
										108
									
								
								.github/workflows/build_public.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										108
									
								
								.github/workflows/build_public.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,108 @@ | ||||
| name: Public Build | ||||
| on: | ||||
|   workflow_run: | ||||
|     workflows: ["Build and Release"] | ||||
|     types: | ||||
|       - completed | ||||
|   workflow_dispatch: | ||||
| jobs: | ||||
|   build: | ||||
|     runs-on: ubuntu-latest | ||||
|      | ||||
|     steps: | ||||
|     - uses: actions/checkout@v4 | ||||
|       with: | ||||
|         fetch-depth: 0 | ||||
|     - name: Set up Go | ||||
|       uses: actions/setup-go@v5 | ||||
|       with: | ||||
|         go-version: '1.25.3' | ||||
|          | ||||
|     - name: Update master branch README files | ||||
|       run: | | ||||
|         git config --global user.name 'GitHub Actions' | ||||
|         git config --global user.email 'actions@github.com' | ||||
|          | ||||
|         if [ -f "go.mod" ]; then | ||||
|           GO_VERSION=$(grep "^go " go.mod | head -n 1 | awk '{print $2}') | ||||
|           echo "提取到的 Go 版本: $GO_VERSION" | ||||
|           if [ -n "$GO_VERSION" ] && [[ "$GO_VERSION" =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then | ||||
|             echo "版本验证成功,开始替换..." | ||||
|             if [ -f "README.md" ]; then | ||||
|               sed -i "s/选择 go [0-9]\+\.[0-9]\+\.[0-9]\+ 的版本进行安装/选择 go $GO_VERSION 的版本进行安装/g" README.md | ||||
|               sed -i 's|但二进制文件编译至 \[securityCheck\].*)|但已开源|g' README.md | ||||
|               sed -i 's|security.*Enable/Disable security test (default true)|security        Enable/Disable security test (default false)|g' README.md | ||||
|               echo "已更新 README.md" | ||||
|             fi | ||||
|             if [ -f "README_EN.md" ]; then | ||||
|               sed -i "s/Select go [0-9]\+\.[0-9]\+\.[0-9]\+ version to install/Select go $GO_VERSION version to install/g" README_EN.md | ||||
|               sed -i 's|but binary files compiled in \[securityCheck\].*)|but open sourced|g' README_EN.md | ||||
|               sed -i 's|security.*Enable/Disable security test (default true)|security        Enable/Disable security test (default false)|g' README_EN.md | ||||
|               echo "已更新 README_EN.md" | ||||
|             fi | ||||
|             git add README.md README_EN.md | ||||
|             git commit -m "Auto update README files" || echo "No changes to commit" | ||||
|             git push origin ${{ github.ref_name }} | ||||
|           else | ||||
|             echo "错误:未能提取到有效的 Go 版本号或版本号格式不正确" | ||||
|             exit 1 | ||||
|           fi | ||||
|         else | ||||
|           echo "错误:未找到 go.mod 文件" | ||||
|           exit 1 | ||||
|         fi | ||||
|          | ||||
|     - name: Create public branch | ||||
|       run: | | ||||
|         git checkout -b public || git checkout public | ||||
|         git merge ${{ github.ref_name }} --no-edit || true | ||||
|          | ||||
|     - name: Remove security package references | ||||
|       run: | | ||||
|         find . -type f -name "*.go" -exec sed -i 's|"github.com/oneclickvirt/security/network"|"github.com/oneclickvirt/basics/network"|g' {} + | ||||
|         sed -i '/SecurityUploadToken/d' utils/utils.go | ||||
|         sed -i 's|"github.com/oneclickvirt/security/network"|"github.com/oneclickvirt/basics/network"|g' utils/utils.go | ||||
|         sed -i '/^import/,/^)/{/^)/a\'$'\n''const token = "OvwKx5qgJtf7PZgCKbtyojSU.MTcwMTUxNzY1MTgwMw"'$'\n''}' utils/utils.go | ||||
|         sed -i '/github.com\/oneclickvirt\/security/d' go.mod | ||||
|         sed -i 's|var securityFlag = flag.Bool("security", true,|var securityFlag = flag.Bool("security", false,|g' goecs.go | ||||
|         sed -i 's|VPS融合怪测试|VPS融合怪测试(非官方编译)|g' utils/utils.go | ||||
|         sed -i 's|VPS Fusion Monster Test|VPS Fusion Monster Test (Unofficial)|g' utils/utils.go | ||||
|         go mod tidy | ||||
|         sed -i 's|但二进制文件编译至 \[securityCheck\].*)|但已开源|g' README.md | ||||
|         sed -i 's|but binary files compiled in \[securityCheck\].*)|but open sourced|g' README_EN.md | ||||
|         sed -i 's|security.*Enable/Disable security test (default true)|security        Enable/Disable security test (default false)|g' README.md | ||||
|         sed -i 's|security.*Enable/Disable security test (default true)|security        Enable/Disable security test (default false)|g' README_EN.md | ||||
|     - name: Update Go version in README files | ||||
|       run: | | ||||
|         if [ -f "go.mod" ]; then | ||||
|           GO_VERSION=$(grep "^go " go.mod | head -n 1 | awk '{print $2}') | ||||
|           echo "提取到的 Go 版本: $GO_VERSION" | ||||
|           if [ -n "$GO_VERSION" ] && [[ "$GO_VERSION" =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then | ||||
|             echo "版本验证成功,开始替换..." | ||||
|             if [ -f "README.md" ]; then | ||||
|               sed -i "s/选择 go [0-9]\+\.[0-9]\+\.[0-9]\+ 的版本进行安装/选择 go $GO_VERSION 的版本进行安装/g" README.md | ||||
|               echo "已更新 README.md" | ||||
|             fi | ||||
|             if [ -f "README_EN.md" ]; then | ||||
|               sed -i "s/Select go [0-9]\+\.[0-9]\+\.[0-9]\+ version to install/Select go $GO_VERSION version to install/g" README_EN.md | ||||
|               echo "已更新 README_EN.md" | ||||
|             fi | ||||
|           else | ||||
|             echo "错误:未能提取到有效的 Go 版本号或版本号格式不正确" | ||||
|             exit 1 | ||||
|           fi | ||||
|         else | ||||
|           echo "错误:未找到 go.mod 文件" | ||||
|           exit 1 | ||||
|         fi | ||||
|     - name: Build and Test | ||||
|       run: | | ||||
|         go build -o maintest | ||||
|         ./maintest -menu=false -l en -security=false -upload=false || exit 1 | ||||
|         rm -rf maintest | ||||
|          | ||||
|     - name: Commit and push changes | ||||
|       run: | | ||||
|         git add . | ||||
|         git commit -m "Auto update public version (no security package)" || echo "No changes to commit" | ||||
|         git push -f origin public | ||||
							
								
								
									
										55
									
								
								.github/workflows/public_build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										55
									
								
								.github/workflows/public_build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,55 +0,0 @@ | ||||
| name: Public Build | ||||
|  | ||||
| on: | ||||
|   workflow_run: | ||||
|     workflows: ["Build and Release"] | ||||
|     types: | ||||
|       - completed | ||||
|   workflow_dispatch: | ||||
|  | ||||
| jobs: | ||||
|   build: | ||||
|     runs-on: ubuntu-latest | ||||
|      | ||||
|     steps: | ||||
|     - uses: actions/checkout@v4 | ||||
|       with: | ||||
|         fetch-depth: 0 | ||||
|  | ||||
|     - name: Set up Go | ||||
|       uses: actions/setup-go@v5 | ||||
|       with: | ||||
|         go-version: '1.24.5' | ||||
|          | ||||
|     - name: Create public branch | ||||
|       run: | | ||||
|         git config --global user.name 'GitHub Actions' | ||||
|         git config --global user.email 'actions@github.com' | ||||
|         git checkout -b public || git checkout public | ||||
|         git merge ${{ github.ref_name }} --no-edit || true | ||||
|          | ||||
|     - name: Remove security package references | ||||
|       run: | | ||||
|         find . -type f -name "*.go" -exec sed -i 's|"github.com/oneclickvirt/security/network"|"github.com/oneclickvirt/basics/network"|g' {} + | ||||
|         sed -i '/SecurityUploadToken/d' utils/utils.go | ||||
|         sed -i 's|"github.com/oneclickvirt/security/network"|"github.com/oneclickvirt/basics/network"|g' utils/utils.go | ||||
|         sed -i '/^import/,/^)/{/^)/a\'$'\n''const token = "OvwKx5qgJtf7PZgCKbtyojSU.MTcwMTUxNzY1MTgwMw"'$'\n''}' utils/utils.go | ||||
|         sed -i '/github.com\/oneclickvirt\/security/d' go.mod | ||||
|         sed -i 's|var securityFlag = flag.Bool("security", true,|var securityFlag = flag.Bool("security", false,|g' goecs.go | ||||
|         go mod tidy | ||||
|         sed -i 's|但二进制文件编译至 \[securityCheck\].*)|但已开源|g' README.md | ||||
|         sed -i 's|but binary files compiled in \[securityCheck\].*)|but open sourced|g' README_EN.md | ||||
|         sed -i 's|security.*Enable/Disable security test (default true)|security        Enable/Disable security test (default false)|g' README.md | ||||
|         sed -i 's|security.*Enable/Disable security test (default true)|security        Enable/Disable security test (default false)|g' README_EN.md | ||||
|  | ||||
|     - name: Build and Test | ||||
|       run: | | ||||
|         go build -o maintest | ||||
|         ./maintest -menu=false -l en -security=false -upload=false || exit 1 | ||||
|         rm -rf maintest | ||||
|          | ||||
|     - name: Commit and push changes | ||||
|       run: | | ||||
|         git add . | ||||
|         git commit -m "Auto update public version (no security package)" || echo "No changes to commit" | ||||
|         git push -f origin public | ||||
							
								
								
									
										29
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								README.md
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  | ||||
| [](https://app.fossa.com/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs?ref=badge_shield) | ||||
|  | ||||
| [](https://hits.spiritlhl.net) | ||||
| [](https://hits.spiritlhl.net) [](https://github.com/oneclickvirt/ecs/releases) | ||||
|  | ||||
| 融合怪测评项目 - GO版本 | ||||
|  | ||||
| @@ -47,15 +47,14 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS | ||||
| |----------------|---------------------------| | ||||
| | Android(arm64) | 存在权限问题未修复,非安卓系统的ARM架构无问题      | | ||||
| | OpenBSD/NetBSD | 部分Goalng的官方库未支持本系统(尤其是net相关项目)  | | ||||
| | Windows虚拟机   | 无Admin权限的mbw测试性能不准确(内存测试) | | ||||
| | Windows物理机(非Admin下)   | 无Admin权限的mbw测试性能不准确(内存测试) | | ||||
|  | ||||
| --- | ||||
|  | ||||
| ## **功能** | ||||
|  | ||||
| - 系统基础信息查询,IP基础信息并发查询:[basics](https://github.com/oneclickvirt/basics)、[gostun](https://github.com/oneclickvirt/gostun) | ||||
| - CPU 测试:[cputest](https://github.com/oneclickvirt/cputest),支持 sysbench(lua/golang版本)、geekbench、winsat | ||||
| - 内存测试:[memorytest](https://github.com/oneclickvirt/memorytest),支持 sysbench、dd | ||||
| - 内存测试:[memorytest](https://github.com/oneclickvirt/memorytest),支持 sysbench、dd、winsat、mbw、stream | ||||
| - 硬盘测试:[disktest](https://github.com/oneclickvirt/disktest),支持 dd、fio、winsat | ||||
| - 流媒体解锁信息并发查询:[netflix-verify](https://github.com/sjlleo/netflix-verify) 等逻辑,开发至 [CommonMediaTests](https://github.com/oneclickvirt/CommonMediaTests) | ||||
| - 常见流媒体测试并发查询:[UnlockTests](https://github.com/oneclickvirt/UnlockTests),逻辑借鉴 [RegionRestrictionCheck](https://github.com/lmc999/RegionRestrictionCheck) 等 | ||||
| @@ -65,7 +64,7 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS | ||||
| - 三网路由测试:基于 [NTrace-core](https://github.com/nxtrace/NTrace-core),二次开发至 [nt3](https://github.com/oneclickvirt/nt3) | ||||
| - 网速测试:基于 [speedtest.net](https://github.com/spiritLHLS/speedtest.net-CN-ID) 和 [speedtest.cn](https://github.com/spiritLHLS/speedtest.cn-CN-ID) 数据,开发至 [oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest) | ||||
| - 三网 Ping 值测试:借鉴 [ecsspeed](https://github.com/spiritLHLS/ecsspeed),二次开发至 [pingtest](https://github.com/oneclickvirt/pingtest) | ||||
| - 支持root或admin环境下测试,支持非root或非admin环境下测试,支持离线环境下进行测试,**暂未**支持无DNS环境下进行测试 | ||||
| - 支持root或admin环境下测试,支持非root或非admin环境下测试,支持离线环境下进行测试,**暂未**支持无DNS的在线环境下进行测试 | ||||
|  | ||||
| **本项目初次使用建议查看说明:[跳转](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md)** | ||||
|  | ||||
| @@ -82,25 +81,25 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS | ||||
| - **国际用户无加速:** | ||||
|  | ||||
|   ```bash | ||||
|   export noninteractive=true && curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs | ||||
|   export noninteractive=true && curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && ./goecs.sh env && ./goecs.sh install && goecs | ||||
|   ``` | ||||
|  | ||||
| - **国际/国内使用 CDN 加速:** | ||||
|  | ||||
|   ```bash | ||||
|   export noninteractive=true && curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs | ||||
|   export noninteractive=true && curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && ./goecs.sh env && ./goecs.sh install && goecs | ||||
|   ``` | ||||
|  | ||||
| - **国内用户使用 CNB 加速:** | ||||
|  | ||||
|   ```bash | ||||
|   export noninteractive=true && curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs | ||||
|   export noninteractive=true && curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh && ./goecs.sh env && ./goecs.sh install && goecs | ||||
|   ``` | ||||
|  | ||||
| - **短链接:** | ||||
|  | ||||
|   ```bash | ||||
|   export noninteractive=true && curl -L https://bash.spiritlhl.net/goecs -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs | ||||
|   export noninteractive=true && curl -L https://bash.spiritlhl.net/goecs -o goecs.sh && chmod +x goecs.sh && ./goecs.sh env && ./goecs.sh install && goecs | ||||
|   ``` | ||||
|  | ||||
| #### **详细说明** | ||||
| @@ -243,6 +242,8 @@ Usage: goecs [options] | ||||
| 1. 下载带 exe 文件的压缩包:[Releases](https://github.com/oneclickvirt/ecs/releases) | ||||
| 2. 解压后,右键以管理员模式运行。 | ||||
|  | ||||
| PS:如果是虚拟机环境,不以管理员模式运行也行,因为虚拟机无原生的测试工具,将自动启用替代方法测试。 | ||||
|  | ||||
| --- | ||||
|  | ||||
| ### **Docker** | ||||
| @@ -302,11 +303,11 @@ cd ecs | ||||
| ``` | ||||
|  | ||||
| 2. 安装 Go 环境(如已安装可跳过) | ||||
|  | ||||
| 选择 go 1.25.3 的版本进行安装 | ||||
|  | ||||
| ```bash | ||||
| # 下载并安装 Go | ||||
| wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz | ||||
| rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.4.linux-amd64.tar.gz | ||||
| export PATH=$PATH:/usr/local/go/bin | ||||
| curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/go.sh -o go.sh && chmod +x go.sh && bash go.sh  | ||||
| ``` | ||||
|  | ||||
| 3. 编译 | ||||
| @@ -374,7 +375,7 @@ GOOS=darwin GOARCH=amd64 go build -o goecs_darwin | ||||
|  | ||||
| ## 致谢 | ||||
|  | ||||
| 感谢 [he.net](https://he.net) [bgp.tools](https://bgp.tools) [ipinfo.io](https://ipinfo.io) [maxmind.com](https://www.maxmind.com/en/home) [cloudflare.com](https://www.cloudflare.com/) [ip.sb](https://ip.sb) [scamalytics.com](https://scamalytics.com) [abuseipdb.com](https://www.abuseipdb.com/) [ip2location.com](https://ip2location.com/) [ip-api.com](https://ip-api.com) [ipregistry.co](https://ipregistry.co/) [ipdata.co](https://ipdata.co/) [ipgeolocation.io](https://ipgeolocation.io) [ipwhois.io](https://ipwhois.io) [ipapi.com](https://ipapi.com/) [ipapi.is](https://ipapi.is/) [ipqualityscore.com](https://www.ipqualityscore.com/) [bigdatacloud.com](https://www.bigdatacloud.com/) [dkly.net](https://data.dkly.net) [virustotal.com](https://www.virustotal.com/) 等网站提供的API进行检测,感谢互联网各网站提供的查询资源 | ||||
| 感谢 [he.net](https://he.net) [bgp.tools](https://bgp.tools) [ipinfo.io](https://ipinfo.io) [maxmind.com](https://www.maxmind.com/en/home) [cloudflare.com](https://www.cloudflare.com/) [ip.sb](https://ip.sb) [scamalytics.com](https://scamalytics.com) [abuseipdb.com](https://www.abuseipdb.com/) [ip2location.com](https://ip2location.com/) [ip-api.com](https://ip-api.com) [ipregistry.co](https://ipregistry.co/) [ipdata.co](https://ipdata.co/) [ipgeolocation.io](https://ipgeolocation.io) [ipwhois.io](https://ipwhois.io) [ipapi.com](https://ipapi.com/) [ipapi.is](https://ipapi.is/) [ipqualityscore.com](https://www.ipqualityscore.com/) [bigdatacloud.com](https://www.bigdatacloud.com/) [dkly.net](https://data.dkly.net) [virustotal.com](https://www.virustotal.com/) [ipfighter.com](https://ipfighter.com/) [getipintel.net](http://check.getipintel.net/) [fraudlogix.com](https://fraudlogix.com) 等网站提供的API进行检测,感谢互联网各网站提供的查询资源 | ||||
|  | ||||
| 感谢 | ||||
|  | ||||
|   | ||||
							
								
								
									
										26
									
								
								README_EN.md
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								README_EN.md
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  | ||||
| [](https://app.fossa.com/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs?ref=badge_shield) | ||||
|  | ||||
| [](https://hits.spiritlhl.net) | ||||
| [](https://hits.spiritlhl.net) [](https://github.com/oneclickvirt/ecs/releases) | ||||
|  | ||||
| Fusion Monster Evaluation Project - GO Version | ||||
|  | ||||
| @@ -47,8 +47,6 @@ Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https: | ||||
| |--------|-------------------------------------------------------------------------------------------------| | ||||
| | Android(arm64) | Permission issues that are not fixed, no problems with ARM architecture for non-Android systems    | | ||||
| | OpenBSD/NetBSD | Some of Goalng's official libraries do not support this system (especially net-related items) | | ||||
| | Windows(Virtual Machines) | Inaccurate mbw test performance without Admin rights (memory tests) |  | ||||
| | Windows(Physical Machines)(not under Admin) | Inaccurate mbw test performance without Admin rights (memory tests) | | ||||
|  | ||||
| --- | ||||
|  | ||||
| @@ -56,7 +54,7 @@ Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https: | ||||
|  | ||||
| - System basic information query and concurrent IP basic information query: Self-developed [basics](https://github.com/oneclickvirt/basics), [gostun](https://github.com/oneclickvirt/gostun) | ||||
| - CPU test: Self-developed [cputest](https://github.com/oneclickvirt/cputest) supporting sysbench(lua/golang version), geekbench, winsat | ||||
| - Memory test: Self-developed [memorytest](https://github.com/oneclickvirt/memorytest) supporting sysbench, dd | ||||
| - Memory test: Self-developed [memorytest](https://github.com/oneclickvirt/memorytest) supporting sysbench, dd, winsat, mbw, stream | ||||
| - Disk test: Self-developed [disktest](https://github.com/oneclickvirt/disktest) supporting dd, fio, winsat | ||||
| - Streaming media unlock information concurrent query: Modified from [netflix-verify](https://github.com/sjlleo/netflix-verify) and more to [CommonMediaTests](https://github.com/oneclickvirt/CommonMediaTests) | ||||
| - Common streaming media tests concurrent query: Self-developed to [UnlockTests](https://github.com/oneclickvirt/UnlockTests), logic modified from [RegionRestrictionCheck](https://github.com/lmc999/RegionRestrictionCheck) and others | ||||
| @@ -66,7 +64,7 @@ Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https: | ||||
| - Three-network route test: Modified from [NTrace-core](https://github.com/nxtrace/NTrace-core) to [nt3](https://github.com/oneclickvirt/nt3) | ||||
| - Speed test: Based on data from [speedtest.net](https://github.com/spiritLHLS/speedtest.net-CN-ID) and [speedtest.cn](https://github.com/spiritLHLS/speedtest.cn-CN-ID), developed to [oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest) | ||||
| - Three-network Ping test: Modified from [ecsspeed](https://github.com/spiritLHLS/ecsspeed) to [pingtest](https://github.com/oneclickvirt/pingtest) | ||||
| - Support root or admin environment testing, support non-root or non-admin environment testing, support offline environment for testing, not support no DNS environment for testing | ||||
| - Support root or admin environment testing, support non-root or non-admin environment testing, support offline environment for testing, **not yet** support no DNS online environment for testing | ||||
|  | ||||
| **For first-time users of this project, it is recommended to check the instructions: [Jump to](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md)** | ||||
|  | ||||
| @@ -83,19 +81,19 @@ Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https: | ||||
| - **International users without acceleration:** | ||||
|  | ||||
|   ```bash | ||||
|   export noninteractive=true && curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs -l en | ||||
|   export noninteractive=true && curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && ./goecs.sh env && ./goecs.sh install && goecs | ||||
|   ``` | ||||
|  | ||||
| - **International/domestic users with CDN acceleration:** | ||||
|  | ||||
|   ```bash | ||||
|   export noninteractive=true && curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs -l en | ||||
|   export noninteractive=true && curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && ./goecs.sh env && ./goecs.sh install && goecs | ||||
|   ``` | ||||
|  | ||||
| - **Domestic users with CNB acceleration:** | ||||
|  | ||||
|   ```bash | ||||
|   export noninteractive=true && curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs -l en | ||||
|   export noninteractive=true && curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh && ./goecs.sh env && ./goecs.sh install && goecs | ||||
|   ``` | ||||
|  | ||||
| - **Short Link:** | ||||
| @@ -243,6 +241,8 @@ Usage: goecs [options] | ||||
| 1. Download the compressed file with the .exe file: [Releases](https://github.com/oneclickvirt/ecs/releases) | ||||
| 2. After unzipping, right-click and run as administrator. | ||||
|  | ||||
| PS: If it's a VM environment, it's OK not to run it in administrator mode, because VMs have no native testing tools and will automatically enable alternative methods for testing. | ||||
|  | ||||
| --- | ||||
|  | ||||
| ### **Docker** | ||||
| @@ -300,11 +300,11 @@ cd ecs | ||||
| ``` | ||||
|  | ||||
| 2. Install Go environment (skip if already installed) | ||||
|  | ||||
| Select go 1.25.3 version to install  | ||||
|  | ||||
| ```bash | ||||
| # Download and install Go | ||||
| wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz | ||||
| rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.4.linux-amd64.tar.gz | ||||
| export PATH=$PATH:/usr/local/go/bin | ||||
| curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/go.sh -o go.sh && chmod +x go.sh && bash go.sh  | ||||
| ``` | ||||
|  | ||||
| 3. Compile | ||||
| @@ -372,7 +372,7 @@ Note that `goecs` allows you to specify CPU test method via parameters. The defa | ||||
|  | ||||
| ## Thanks | ||||
|  | ||||
| Thank [he.net](https://he.net) [bgp.tools](https://bgp.tools) [ipinfo.io](https://ipinfo.io) [maxmind.com](https://www.maxmind.com/en/home) [cloudflare.com](https://www.cloudflare.com/) [ip.sb](https://ip.sb) [scamalytics.com](https://scamalytics.com) [abuseipdb.com](https://www.abuseipdb.com/) [ip2location.com](https://ip2location.com/) [ip-api.com](https://ip-api.com) [ipregistry.co](https://ipregistry.co/) [ipdata.co](https://ipdata.co/) [ipgeolocation.io](https://ipgeolocation.io) [ipwhois.io](https://ipwhois.io) [ipapi.com](https://ipapi.com/) [ipapi.is](https://ipapi.is/) [ipqualityscore.com](https://www.ipqualityscore.com/) [bigdatacloud.com](https://www.bigdatacloud.com/) [dkly.net](https://data.dkly.net) [virustotal.com](https://www.virustotal.com/) and others for providing APIs for testing, and thanks to various websites on the Internet for providing query resources. | ||||
| Thank [he.net](https://he.net) [bgp.tools](https://bgp.tools) [ipinfo.io](https://ipinfo.io) [maxmind.com](https://www.maxmind.com/en/home) [cloudflare.com](https://www.cloudflare.com/) [ip.sb](https://ip.sb) [scamalytics.com](https://scamalytics.com) [abuseipdb.com](https://www.abuseipdb.com/) [ip2location.com](https://ip2location.com/) [ip-api.com](https://ip-api.com) [ipregistry.co](https://ipregistry.co/) [ipdata.co](https://ipdata.co/) [ipgeolocation.io](https://ipgeolocation.io) [ipwhois.io](https://ipwhois.io) [ipapi.com](https://ipapi.com/) [ipapi.is](https://ipapi.is/) [ipqualityscore.com](https://www.ipqualityscore.com/) [bigdatacloud.com](https://www.bigdatacloud.com/) [dkly.net](https://data.dkly.net) [virustotal.com](https://www.virustotal.com/) [ipfighter.com](https://ipfighter.com/) [getipintel.net](http://check.getipintel.net/) [fraudlogix.com](https://fraudlogix.com) and others for providing APIs for testing, and thanks to various websites on the Internet for providing query resources. | ||||
|  | ||||
| Thank | ||||
|  | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										49
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										49
									
								
								go.mod
									
									
									
									
									
								
							| @@ -1,22 +1,22 @@ | ||||
| module github.com/oneclickvirt/ecs | ||||
|  | ||||
| go 1.24.5 | ||||
| go 1.25.3 | ||||
|  | ||||
| require ( | ||||
| 	github.com/imroc/req/v3 v3.54.0 | ||||
| 	github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841 | ||||
| 	github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204 | ||||
| 	github.com/oneclickvirt/UnlockTests v0.0.30-20251030112700 | ||||
| 	github.com/oneclickvirt/backtrace v0.0.7-20250811023541 | ||||
| 	github.com/oneclickvirt/basics v0.0.15-20250805084236 | ||||
| 	github.com/oneclickvirt/basics v0.0.16-20251030093657 | ||||
| 	github.com/oneclickvirt/cputest v0.0.12-20250720122317 | ||||
| 	github.com/oneclickvirt/defaultset v0.0.2-20240624082446 | ||||
| 	github.com/oneclickvirt/disktest v0.0.10-20250808140407 | ||||
| 	github.com/oneclickvirt/disktest v0.0.10-20250924030424 | ||||
| 	github.com/oneclickvirt/gostun v0.0.5-20250727155022 | ||||
| 	github.com/oneclickvirt/memorytest v0.0.9-20250808065154 | ||||
| 	github.com/oneclickvirt/nt3 v0.0.8-20250810151538 | ||||
| 	github.com/oneclickvirt/memorytest v0.0.10-20250924154648 | ||||
| 	github.com/oneclickvirt/nt3 v0.0.9-20251031045617 | ||||
| 	github.com/oneclickvirt/pingtest v0.0.8-20250728015259 | ||||
| 	github.com/oneclickvirt/portchecker v0.0.3-20250728015900 | ||||
| 	github.com/oneclickvirt/security v0.0.6-20250805090112 | ||||
| 	github.com/oneclickvirt/security v0.0.7-20251030094114 | ||||
| 	github.com/oneclickvirt/speedtest v0.0.10-20250728015734 | ||||
| ) | ||||
|  | ||||
| @@ -57,10 +57,11 @@ require ( | ||||
| 	github.com/mitchellh/go-homedir v1.1.0 // indirect | ||||
| 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||||
| 	github.com/modern-go/reflect2 v1.0.2 // indirect | ||||
| 	github.com/nxtrace/NTrace-core v1.4.2 // indirect | ||||
| 	github.com/nxtrace/NTrace-core v1.4.3-rc.1 // indirect | ||||
| 	github.com/oneclickvirt/dd v0.0.2-20250808062818 // indirect | ||||
| 	github.com/oneclickvirt/fio v0.0.2-20250808045755 // indirect | ||||
| 	github.com/oneclickvirt/mbw v0.0.1-20250808061222 // indirect | ||||
| 	github.com/oneclickvirt/stream v0.0.2-20250924154001 // indirect | ||||
| 	github.com/oschwald/maxminddb-golang v1.13.1 // indirect | ||||
| 	github.com/pelletier/go-toml/v2 v2.2.4 // indirect | ||||
| 	github.com/pion/dtls/v2 v2.2.7 // indirect | ||||
| @@ -76,35 +77,37 @@ require ( | ||||
| 	github.com/refraction-networking/utls v1.7.3 // indirect | ||||
| 	github.com/rivo/uniseg v0.4.7 // indirect | ||||
| 	github.com/rodaine/table v1.3.0 // indirect | ||||
| 	github.com/sagikazarmark/locafero v0.9.0 // indirect | ||||
| 	github.com/sagikazarmark/locafero v0.11.0 // indirect | ||||
| 	github.com/schollz/progressbar/v3 v3.14.4 // indirect | ||||
| 	github.com/shirou/gopsutil v3.21.11+incompatible // indirect | ||||
| 	github.com/shirou/gopsutil/v4 v4.25.6 // indirect | ||||
| 	github.com/showwin/speedtest-go v1.7.10 // indirect | ||||
| 	github.com/sourcegraph/conc v0.3.0 // indirect | ||||
| 	github.com/spf13/afero v1.14.0 // indirect | ||||
| 	github.com/spf13/cast v1.9.2 // indirect | ||||
| 	github.com/spf13/pflag v1.0.7 // indirect | ||||
| 	github.com/spf13/viper v1.20.1 // indirect | ||||
| 	github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect | ||||
| 	github.com/spf13/afero v1.15.0 // indirect | ||||
| 	github.com/spf13/cast v1.10.0 // indirect | ||||
| 	github.com/spf13/pflag v1.0.10 // indirect | ||||
| 	github.com/spf13/viper v1.21.0 // indirect | ||||
| 	github.com/subosito/gotenv v1.6.0 // indirect | ||||
| 	github.com/tidwall/gjson v1.18.0 // indirect | ||||
| 	github.com/tidwall/match v1.1.1 // indirect | ||||
| 	github.com/tidwall/pretty v1.2.1 // indirect | ||||
| 	github.com/tklauser/go-sysconf v0.3.14 // indirect | ||||
| 	github.com/tklauser/numcpus v0.8.0 // indirect | ||||
| 	github.com/tsosunchia/powclient v0.1.5 // indirect | ||||
| 	github.com/tsosunchia/powclient v0.2.0 // indirect | ||||
| 	github.com/xjasonlyu/windivert-go v0.0.0-20201010013527-4239d0afa76f // indirect | ||||
| 	github.com/yusufpapurcu/wmi v1.2.4 // indirect | ||||
| 	go.uber.org/mock v0.5.2 // indirect | ||||
| 	go.uber.org/multierr v1.11.0 // indirect | ||||
| 	go.uber.org/zap v1.27.0 // indirect | ||||
| 	golang.org/x/crypto v0.40.0 // indirect | ||||
| 	golang.org/x/mod v0.25.0 // indirect | ||||
| 	golang.org/x/net v0.42.0 // indirect | ||||
| 	golang.org/x/sync v0.16.0 // indirect | ||||
| 	golang.org/x/sys v0.34.0 // indirect | ||||
| 	golang.org/x/term v0.33.0 // indirect | ||||
| 	golang.org/x/text v0.27.0 // indirect | ||||
| 	golang.org/x/tools v0.34.0 // indirect | ||||
| 	go.yaml.in/yaml/v3 v3.0.4 // indirect | ||||
| 	golang.org/x/crypto v0.42.0 // indirect | ||||
| 	golang.org/x/mod v0.27.0 // indirect | ||||
| 	golang.org/x/net v0.44.0 // indirect | ||||
| 	golang.org/x/sync v0.17.0 // indirect | ||||
| 	golang.org/x/sys v0.36.0 // indirect | ||||
| 	golang.org/x/term v0.35.0 // indirect | ||||
| 	golang.org/x/text v0.29.0 // indirect | ||||
| 	golang.org/x/tools v0.36.0 // indirect | ||||
| 	gopkg.in/yaml.v3 v3.0.1 // indirect | ||||
| 	howett.net/plist v1.0.0 // indirect | ||||
| ) | ||||
|   | ||||
							
								
								
									
										103
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										103
									
								
								go.sum
									
									
									
									
									
								
							| @@ -92,42 +92,44 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w | ||||
| github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | ||||
| github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= | ||||
| github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= | ||||
| github.com/nxtrace/NTrace-core v1.4.2 h1:dSRP18Bn3VGf5CZBzKt8gQWW9mDkq62Np9TCF9RAtp0= | ||||
| github.com/nxtrace/NTrace-core v1.4.2/go.mod h1:wIDOlccuYzY3wBqU89pv2KGHT41i3JA0eRqJU/x9eX4= | ||||
| github.com/nxtrace/NTrace-core v1.4.3-rc.1 h1:V19tkw3kKAMQOOh7Ibb/jZFBk4kMUfQYmpxxtsOfYWo= | ||||
| github.com/nxtrace/NTrace-core v1.4.3-rc.1/go.mod h1:lGhfZ916pEUJh+VzWZTYu7bKBo06pAn+/gXb0A/7gGg= | ||||
| github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841 h1:Zef93z9UiZQwRAKnnZYALmpBKvvuVaq34MEsuWwk6nc= | ||||
| github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841/go.mod h1:DAmFPRjFV5p9fEzUUSml5jJGn2f1NZJQCzTxITHDjc4= | ||||
| github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204 h1:apFaEbHGKflYMZzK17nXzEai4GG873mTd+d9hCO/KdY= | ||||
| github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204/go.mod h1:oOa6wj/qECtRMxwBO6D7o0L0F0Q/5sQ747OCnFQqoGE= | ||||
| github.com/oneclickvirt/UnlockTests v0.0.30-20251030112700 h1:dtHHyWZdshox8StzrjgImj3Rvqwup5OZJ8FAZZQjPIA= | ||||
| github.com/oneclickvirt/UnlockTests v0.0.30-20251030112700/go.mod h1:oOa6wj/qECtRMxwBO6D7o0L0F0Q/5sQ747OCnFQqoGE= | ||||
| github.com/oneclickvirt/backtrace v0.0.7-20250811023541 h1:GzkzvUC6U9b6Dkz/Bl4JRPeQ7XBGoW7Qw1aWqzhF+MQ= | ||||
| github.com/oneclickvirt/backtrace v0.0.7-20250811023541/go.mod h1:/+KUtOWz48TyiTTbhVTsp3D6b5WY+4pCgvFBYtUGtns= | ||||
| github.com/oneclickvirt/basics v0.0.15-20250805084236 h1:guYO6wGooSIOAIutuy/zfJ4sXj525nBITw8cjEPRaK8= | ||||
| github.com/oneclickvirt/basics v0.0.15-20250805084236/go.mod h1:2PV+1ge01zb0Sqzj2V2I7P0wAdFSLF1XgAiumchJJbg= | ||||
| github.com/oneclickvirt/basics v0.0.16-20251030093657 h1:6SWWILNjJfMTXbspqYRpktUEOe/QIVhGonKO8ODC7n4= | ||||
| github.com/oneclickvirt/basics v0.0.16-20251030093657/go.mod h1:2PV+1ge01zb0Sqzj2V2I7P0wAdFSLF1XgAiumchJJbg= | ||||
| github.com/oneclickvirt/cputest v0.0.12-20250720122317 h1:toiwAK1hZE5b8klu2mOQ7J4sv5yV9lpPKwgPahfRYBQ= | ||||
| github.com/oneclickvirt/cputest v0.0.12-20250720122317/go.mod h1:vjlH8tkPFft1tlLOpeNskXVvurxkHaJ3+dgFxQGLXY4= | ||||
| github.com/oneclickvirt/dd v0.0.2-20250808062818 h1:0KHrKkdpL5oBE1OHsrRd2siRw4/2k6f9LBaP7T4JpOc= | ||||
| github.com/oneclickvirt/dd v0.0.2-20250808062818/go.mod h1:tImu9sPTkLWo2tf1dEN1xQzrylWKauj9hbU8PHfyAeU= | ||||
| github.com/oneclickvirt/defaultset v0.0.2-20240624082446 h1:5Pg3mK/u/vQvSz7anu0nxzrNdELi/AcDAU1mMsmPzyc= | ||||
| github.com/oneclickvirt/defaultset v0.0.2-20240624082446/go.mod h1:e9Jt4tf2sbemCtc84/XgKcHy9EZ2jkc5x2sW1NiJS+E= | ||||
| github.com/oneclickvirt/disktest v0.0.10-20250808140407 h1:oUfi5zF3htUTB1ZJuClmK0o74ufP7icbu8LYCnxEOxE= | ||||
| github.com/oneclickvirt/disktest v0.0.10-20250808140407/go.mod h1:Vp3iMVBD4ccReDJz5n5SlzUdq0kDuVhpRklQk21KT+8= | ||||
| github.com/oneclickvirt/disktest v0.0.10-20250924030424 h1:56Aq2xygO/vA/co5vJ7/MQTNijIDl8eYbVk8uCWN4mI= | ||||
| github.com/oneclickvirt/disktest v0.0.10-20250924030424/go.mod h1:Vp3iMVBD4ccReDJz5n5SlzUdq0kDuVhpRklQk21KT+8= | ||||
| github.com/oneclickvirt/fio v0.0.2-20250808045755 h1:eWihCRWcalJjPIdrF8dMe68ZiPnMkSfHC8ENvElp/xE= | ||||
| github.com/oneclickvirt/fio v0.0.2-20250808045755/go.mod h1:NIq+XYTey68KNERGIy/oRDlzpwLzBVoHOCiqX8didsE= | ||||
| github.com/oneclickvirt/gostun v0.0.5-20250727155022 h1:/e3gSUrOp1tg/1NTRx+P8B51OGcP26Q6//5EoSIjOvk= | ||||
| github.com/oneclickvirt/gostun v0.0.5-20250727155022/go.mod h1:pfp7MFZJK9n/KTLAVqqFcCAns4xqMykmjI+1UeF/vdE= | ||||
| github.com/oneclickvirt/mbw v0.0.1-20250808061222 h1:WGXOe6QvHiDRhPVMI0VcctjzW08kGvJf50yq5YeZCtw= | ||||
| github.com/oneclickvirt/mbw v0.0.1-20250808061222/go.mod h1:0Vq6NRpyLmGUdfHfL3uDcFsuZhi7KlG+OCs5ky2757Y= | ||||
| github.com/oneclickvirt/memorytest v0.0.9-20250808065154 h1:mjYOvpFz2mpDU9MNjj66oIDcc2r6+zoW8veP616/+4Q= | ||||
| github.com/oneclickvirt/memorytest v0.0.9-20250808065154/go.mod h1:DBxiVZX7mWCe0Fy+qu57ENheLo00sLfjKzvxiICrUtU= | ||||
| github.com/oneclickvirt/nt3 v0.0.8-20250810151538 h1:pXxtvTwTFWAh/+Hz89wDat42CFjqNdlFyASPRxSdE5g= | ||||
| github.com/oneclickvirt/nt3 v0.0.8-20250810151538/go.mod h1:F1v+6xInBKnbUa8gV1M40R1HOzxg+obtduNhx3CTnmA= | ||||
| github.com/oneclickvirt/memorytest v0.0.10-20250924154648 h1:trk6oZ7xs1eVtr+6oIv5IX8LDVtEMG+E6GVzQ810BtU= | ||||
| github.com/oneclickvirt/memorytest v0.0.10-20250924154648/go.mod h1:4kiHsEWkW9r3/1ZcV5xIweU0smiKP0IRfQj74AUIiVI= | ||||
| github.com/oneclickvirt/nt3 v0.0.9-20251031045617 h1:g42R4kwOL4s6sDsG+axEXJsI82pldv42HLMYCDFypNg= | ||||
| github.com/oneclickvirt/nt3 v0.0.9-20251031045617/go.mod h1:yo1ufkduFt9QjqG7nqSUf1D3YlQOmFpdlTYniJfclQI= | ||||
| github.com/oneclickvirt/pingtest v0.0.8-20250728015259 h1:egoxZRZBOWN3JqBwqEsULDyRo2/dpGMeWcmV3U87zig= | ||||
| github.com/oneclickvirt/pingtest v0.0.8-20250728015259/go.mod h1:gxwsxxwitNQiGq2OI0ZogYoOLwc8DtuOdSRe6/EvRqs= | ||||
| github.com/oneclickvirt/portchecker v0.0.3-20250728015900 h1:AomzdppSOFB70AJESQhlp0IPbsHTTJGimAWDk2TzCWM= | ||||
| github.com/oneclickvirt/portchecker v0.0.3-20250728015900/go.mod h1:9sjMDPCd4Z40wkYB0S9gQPGH8YPtnNE1ZJthVIuHUzA= | ||||
| github.com/oneclickvirt/security v0.0.6-20250805090112 h1:lUNtsnpZ3JNLS4xxjFGGECaxA46yNyxbYjdust9W0M4= | ||||
| github.com/oneclickvirt/security v0.0.6-20250805090112/go.mod h1:JB6SJWm5pbrngCgSTYLd2m4Hj8mHO6mJua1WgHMZOcE= | ||||
| github.com/oneclickvirt/security v0.0.7-20251030094114 h1:Ax8J1TYqprXyiWNAIJJ3xhoyGhvBlKw4m9j6va5Q2nM= | ||||
| github.com/oneclickvirt/security v0.0.7-20251030094114/go.mod h1:YfDilPFW22szjdUNgv4VOuSwHnZzsFsdPOfRYiMoc3I= | ||||
| github.com/oneclickvirt/speedtest v0.0.10-20250728015734 h1:HKO7/JQ74ueXA8Wo8NIvcK9DphbEG/YTfAAVz/akSiY= | ||||
| github.com/oneclickvirt/speedtest v0.0.10-20250728015734/go.mod h1:0W8vnMbA3iucXLXFdGfe9Ia6RPS0izRO7jvu/SnH1P8= | ||||
| github.com/oneclickvirt/stream v0.0.2-20250924154001 h1:GuJWdiPkoK84+y/+oHKr2Ghl3c/MzS9Z5m1nM+lMmy4= | ||||
| github.com/oneclickvirt/stream v0.0.2-20250924154001/go.mod h1:oWaizaHTC2VQciBC9RfaLbAOf8qeR6n20/gY7QxriDE= | ||||
| github.com/oschwald/maxminddb-golang v1.13.1 h1:G3wwjdN9JmIK2o/ermkHM+98oX5fS+k5MbwsmL4MRQE= | ||||
| github.com/oschwald/maxminddb-golang v1.13.1/go.mod h1:K4pgV9N/GcK694KSTmVSDTODk4IsCNThNdTmnaBZ/F8= | ||||
| github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= | ||||
| @@ -162,10 +164,10 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= | ||||
| github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= | ||||
| github.com/rodaine/table v1.3.0 h1:4/3S3SVkHnVZX91EHFvAMV7K42AnJ0XuymRR2C5HlGE= | ||||
| github.com/rodaine/table v1.3.0/go.mod h1:47zRsHar4zw0jgxGxL9YtFfs7EGN6B/TaS+/Dmk4WxU= | ||||
| github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= | ||||
| github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= | ||||
| github.com/sagikazarmark/locafero v0.9.0 h1:GbgQGNtTrEmddYDSAH9QLRyfAHY12md+8YFTqyMTC9k= | ||||
| github.com/sagikazarmark/locafero v0.9.0/go.mod h1:UBUyz37V+EdMS3hDF3QWIiVr/2dPrx49OMO0Bn0hJqk= | ||||
| github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= | ||||
| github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= | ||||
| github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= | ||||
| github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= | ||||
| github.com/schollz/progressbar/v3 v3.14.4 h1:W9ZrDSJk7eqmQhd3uxFNNcTr0QL+xuGNI9dEMrw0r74= | ||||
| github.com/schollz/progressbar/v3 v3.14.4/go.mod h1:aT3UQ7yGm+2ZjeXPqsjTenwL3ddUiuZ0kfQ/2tHlyNI= | ||||
| github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= | ||||
| @@ -174,16 +176,16 @@ github.com/shirou/gopsutil/v4 v4.25.6 h1:kLysI2JsKorfaFPcYmcJqbzROzsBWEOAtw6A7dI | ||||
| github.com/shirou/gopsutil/v4 v4.25.6/go.mod h1:PfybzyydfZcN+JMMjkF6Zb8Mq1A/VcogFFg7hj50W9c= | ||||
| github.com/showwin/speedtest-go v1.7.10 h1:9o5zb7KsuzZKn+IE2//z5btLKJ870JwO6ETayUkqRFw= | ||||
| github.com/showwin/speedtest-go v1.7.10/go.mod h1:Ei7OCTmNPdWofMadzcfgq1rUO7mvJy9Jycj//G7vyfA= | ||||
| github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= | ||||
| github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= | ||||
| github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA= | ||||
| github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo= | ||||
| github.com/spf13/cast v1.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE= | ||||
| github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= | ||||
| github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M= | ||||
| github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= | ||||
| github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= | ||||
| github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= | ||||
| github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= | ||||
| github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U= | ||||
| github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= | ||||
| github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= | ||||
| github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= | ||||
| github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= | ||||
| github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= | ||||
| github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= | ||||
| github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= | ||||
| github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= | ||||
| github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||||
| github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= | ||||
| github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= | ||||
| @@ -194,8 +196,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO | ||||
| github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= | ||||
| github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= | ||||
| github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= | ||||
| github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= | ||||
| github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= | ||||
| github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= | ||||
| github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= | ||||
| github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= | ||||
| github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= | ||||
| github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= | ||||
| @@ -209,8 +211,10 @@ github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZ | ||||
| github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= | ||||
| github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY= | ||||
| github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE= | ||||
| github.com/tsosunchia/powclient v0.1.5 h1:hpixFWoPbWSEC0zc9osSltyjtr1+SnhCueZVLkEpyyU= | ||||
| github.com/tsosunchia/powclient v0.1.5/go.mod h1:yNlzyq+w9llYZV+0q7nrX83ULy4ghq2mCjpTLJFJ2pg= | ||||
| github.com/tsosunchia/powclient v0.2.0 h1:BDrI3O69CbzarbD+CnnY10Kuwn8xlmtQR0m5tBp+BG8= | ||||
| github.com/tsosunchia/powclient v0.2.0/go.mod h1:fkb7tTW+HMH3ZWZzQUgwvvFKMj/8Ys+C8Sm/uGQzDA0= | ||||
| github.com/xjasonlyu/windivert-go v0.0.0-20201010013527-4239d0afa76f h1:glX3VZCYwW1/OmFxOjazfCtBLxXB3YNZk9LF2lYx+Lw= | ||||
| github.com/xjasonlyu/windivert-go v0.0.0-20201010013527-4239d0afa76f/go.mod h1:gh//RKyt2Gesx3eOj3ulzrSQ60ySj2UA4qnOdrtarvg= | ||||
| github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= | ||||
| github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= | ||||
| github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= | ||||
| @@ -224,19 +228,21 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= | ||||
| go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= | ||||
| go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= | ||||
| go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= | ||||
| go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= | ||||
| go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= | ||||
| golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | ||||
| golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | ||||
| golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= | ||||
| golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= | ||||
| golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= | ||||
| golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= | ||||
| golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= | ||||
| golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI= | ||||
| golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8= | ||||
| golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= | ||||
| golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= | ||||
| golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= | ||||
| golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= | ||||
| golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= | ||||
| golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= | ||||
| golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= | ||||
| golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= | ||||
| golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||||
| golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= | ||||
| @@ -245,17 +251,18 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= | ||||
| golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= | ||||
| golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= | ||||
| golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= | ||||
| golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= | ||||
| golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= | ||||
| golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= | ||||
| golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= | ||||
| golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= | ||||
| golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= | ||||
| golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= | ||||
| golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= | ||||
| golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20201008064518-c1f3e3309c71/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| @@ -267,8 +274,8 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= | ||||
| golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= | ||||
| golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= | ||||
| golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= | ||||
| golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= | ||||
| golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= | ||||
| golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= | ||||
| golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= | ||||
| @@ -276,23 +283,23 @@ golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= | ||||
| golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= | ||||
| golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= | ||||
| golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= | ||||
| golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= | ||||
| golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= | ||||
| golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ= | ||||
| golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA= | ||||
| golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||||
| golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | ||||
| golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= | ||||
| golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= | ||||
| golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= | ||||
| golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= | ||||
| golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= | ||||
| golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= | ||||
| golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= | ||||
| golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= | ||||
| golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||||
| golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= | ||||
| golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= | ||||
| golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= | ||||
| golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= | ||||
| golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= | ||||
| golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= | ||||
| golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
| golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
| golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
|   | ||||
							
								
								
									
										68
									
								
								goecs.go
									
									
									
									
									
								
							
							
						
						
									
										68
									
								
								goecs.go
									
									
									
									
									
								
							| @@ -7,7 +7,6 @@ import ( | ||||
| 	"fmt" | ||||
| 	"net/http" | ||||
| 	"os" | ||||
| 	"os/exec" | ||||
| 	"os/signal" | ||||
| 	"regexp" | ||||
| 	"runtime" | ||||
| @@ -40,7 +39,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| var ( | ||||
| 	ecsVersion                                                        = "v0.1.79" | ||||
| 	ecsVersion                                                        = "v0.1.93" | ||||
| 	menuMode                                                          bool | ||||
| 	onlyChinaTest                                                     bool | ||||
| 	input, choice                                                     string | ||||
| @@ -140,7 +139,7 @@ func parseFlags() { | ||||
| 	goecsFlag.BoolVar(&speedTestStatus, "speed", true, "Enable/Disable speed test") | ||||
| 	goecsFlag.StringVar(&cpuTestMethod, "cpum", "sysbench", "Set CPU test method (supported: sysbench, geekbench, winsat)") | ||||
| 	goecsFlag.StringVar(&cpuTestThreadMode, "cput", "multi", "Set CPU test thread mode (supported: single, multi)") | ||||
| 	goecsFlag.StringVar(&memoryTestMethod, "memorym", "sysbench", "Set memory test method (supported: sysbench, dd, winsat)") | ||||
| 	goecsFlag.StringVar(&memoryTestMethod, "memorym", "stream", "Set memory test method (supported: stream, sysbench, dd, winsat, auto)") | ||||
| 	goecsFlag.StringVar(&diskTestMethod, "diskm", "fio", "Set disk test method (supported: fio, dd, winsat)") | ||||
| 	goecsFlag.StringVar(&diskTestPath, "diskp", "", "Set disk test path, e.g., -diskp /root") | ||||
| 	goecsFlag.BoolVar(&diskMultiCheck, "diskmc", false, "Enable/Disable multiple disk checks, e.g., -diskmc=false") | ||||
| @@ -247,23 +246,7 @@ Loop: | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // clearScreen 清屏 | ||||
| func clearScreen() { | ||||
| 	var cmd *exec.Cmd | ||||
| 	switch runtime.GOOS { | ||||
| 	case "windows": | ||||
| 		cmd = exec.Command("cmd", "/c", "cls") | ||||
| 	case "darwin": | ||||
| 		cmd = exec.Command("clear") | ||||
| 	default: | ||||
| 		cmd = exec.Command("clear") | ||||
| 	} | ||||
| 	cmd.Stdout = os.Stdout | ||||
| 	_ = cmd.Run() | ||||
| } | ||||
|  | ||||
| func printMenuOptions(preCheck utils.NetCheckResult) { | ||||
| 	clearScreen() // 清屏 | ||||
| 	var stats *utils.StatsResponse | ||||
| 	var statsErr error | ||||
| 	var githubInfo *utils.GitHubRelease | ||||
| @@ -546,7 +529,7 @@ func handleSignalInterrupt(sig chan os.Signal, startTime *time.Time, output *str | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3, wg4, wg5 *sync.WaitGroup, basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo *string, output *string, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) { | ||||
| func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3 *sync.WaitGroup, basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo *string, output *string, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) { | ||||
| 	*output = runBasicTests(preCheck, basicInfo, securityInfo, *output, tempOutput, outputMutex) | ||||
| 	*output = runCPUTest(*output, tempOutput, outputMutex) | ||||
| 	*output = runMemoryTest(*output, tempOutput, outputMutex) | ||||
| @@ -554,7 +537,6 @@ func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3, wg4, wg5 *syn | ||||
| 	if onlyIpInfoCheckStatus && !basicStatus && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { | ||||
| 		*output = runIpInfoCheck(*output, tempOutput, outputMutex) | ||||
| 	} | ||||
| 	var backtraceInfo, nt3Info string | ||||
| 	if utTestStatus && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" && !onlyChinaTest { | ||||
| 		wg1.Add(1) | ||||
| 		go func() { | ||||
| @@ -576,33 +558,13 @@ func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3, wg4, wg5 *syn | ||||
| 			*ptInfo = pt.PingTest() | ||||
| 		}() | ||||
| 	} | ||||
| 	if runtime.GOOS != "windows" && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { | ||||
| 		if backtraceStatus && !onlyChinaTest { | ||||
| 			wg4.Add(1) | ||||
| 			go func() { | ||||
| 				defer wg4.Done() | ||||
| 				backtraceInfo = utils.PrintAndCapture(func() { | ||||
| 					upstreams.UpstreamsCheck() | ||||
| 				}, "", "") | ||||
| 			}() | ||||
| 		} | ||||
| 		if nt3Status && !onlyChinaTest { | ||||
| 			wg5.Add(1) | ||||
| 			go func() { | ||||
| 				defer wg5.Done() | ||||
| 				nt3Info = utils.PrintAndCapture(func() { | ||||
| 					nexttrace.NextTrace3Check(language, nt3Location, nt3CheckType) | ||||
| 				}, "", "") | ||||
| 			}() | ||||
| 		} | ||||
| 	} | ||||
| 	if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { | ||||
| 		*output = runStreamingTests(wg1, mediaInfo, *output, tempOutput, outputMutex) | ||||
| 		*output = runSecurityTests(*securityInfo, *output, tempOutput, outputMutex) | ||||
| 		*output = runEmailTests(wg2, emailInfo, *output, tempOutput, outputMutex) | ||||
| 	} | ||||
| 	if runtime.GOOS != "windows" && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { | ||||
| 		*output = runNetworkTests(wg3, wg4, wg5, ptInfo, &backtraceInfo, &nt3Info, *output, tempOutput, outputMutex) | ||||
| 		*output = runNetworkTests(wg3, ptInfo, *output, tempOutput, outputMutex) | ||||
| 	} | ||||
| 	if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { | ||||
| 		*output = runSpeedTests(*output, tempOutput, outputMutex) | ||||
| @@ -814,23 +776,17 @@ func runEmailTests(wg2 *sync.WaitGroup, emailInfo *string, output, tempOutput st | ||||
| 	}, tempOutput, output) | ||||
| } | ||||
|  | ||||
| func runNetworkTests(wg3, wg4, wg5 *sync.WaitGroup, ptInfo, backtraceInfo, nt3Info *string, output, tempOutput string, outputMutex *sync.Mutex) string { | ||||
| func runNetworkTests(wg3 *sync.WaitGroup, ptInfo *string, output, tempOutput string, outputMutex *sync.Mutex) string { | ||||
| 	outputMutex.Lock() | ||||
| 	defer outputMutex.Unlock() | ||||
| 	return utils.PrintAndCapture(func() { | ||||
| 		if backtraceStatus && !onlyChinaTest && *backtraceInfo != "" { | ||||
| 			if wg4 != nil { | ||||
| 				wg4.Wait() | ||||
| 			} | ||||
| 		if backtraceStatus && !onlyChinaTest { | ||||
| 			utils.PrintCenteredTitle("上游及回程线路检测", width) | ||||
| 			fmt.Print(*backtraceInfo) | ||||
| 			upstreams.UpstreamsCheck() // 不能在重定向的同时外部并发,此处仅可以顺序执行 | ||||
| 		} | ||||
| 		if nt3Status && !onlyChinaTest && *nt3Info != "" { | ||||
| 			if wg5 != nil { | ||||
| 				wg5.Wait() | ||||
| 			} | ||||
| 		if nt3Status && !onlyChinaTest { | ||||
| 			utils.PrintCenteredTitle("三网回程路由检测", width) | ||||
| 			fmt.Print(*nt3Info) | ||||
| 			nexttrace.NextTrace3Check(language, nt3Location, nt3CheckType) // 不能在重定向的同时外部并发,此处仅可以顺序执行 | ||||
| 		} | ||||
| 		if (onlyChinaTest || pingTestStatus) && *ptInfo != "" { | ||||
| 			wg3.Wait() | ||||
| @@ -901,8 +857,10 @@ func handleUploadResults(output string) { | ||||
| 	if httpURL != "" || httpsURL != "" { | ||||
| 		if language == "en" { | ||||
| 			fmt.Printf("Upload successfully!\nHttp URL:  %s\nHttps URL: %s\n", httpURL, httpsURL) | ||||
| 			fmt.Println("Each Test Benchmark: https://bash.spiritlhl.net/ecsguide") | ||||
| 		} else { | ||||
| 			fmt.Printf("上传成功!\nHttp URL:  %s\nHttps URL: %s\n", httpURL, httpsURL) | ||||
| 			fmt.Println("每项测试基准见: https://bash.spiritlhl.net/ecsguide") | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @@ -929,7 +887,7 @@ func main() { | ||||
| 		enabelUpload = false | ||||
| 	} | ||||
| 	var ( | ||||
| 		wg1, wg2, wg3, wg4, wg5                               sync.WaitGroup | ||||
| 		wg1, wg2, wg3                                         sync.WaitGroup | ||||
| 		basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo string | ||||
| 		output, tempOutput                                    string | ||||
| 		outputMutex                                           sync.Mutex | ||||
| @@ -941,7 +899,7 @@ func main() { | ||||
| 	go handleSignalInterrupt(sig, &startTime, &output, tempOutput, uploadDone, &outputMutex) | ||||
| 	switch language { | ||||
| 	case "zh": | ||||
| 		runChineseTests(preCheck, &wg1, &wg2, &wg3, &wg4, &wg5, &basicInfo, &securityInfo, &emailInfo, &mediaInfo, &ptInfo, &output, tempOutput, startTime, &outputMutex) | ||||
| 		runChineseTests(preCheck, &wg1, &wg2, &wg3, &basicInfo, &securityInfo, &emailInfo, &mediaInfo, &ptInfo, &output, tempOutput, startTime, &outputMutex) | ||||
| 	case "en": | ||||
| 		runEnglishTests(preCheck, &wg1, &wg2, &basicInfo, &securityInfo, &emailInfo, &mediaInfo, &output, tempOutput, startTime, &outputMutex) | ||||
| 	default: | ||||
|   | ||||
							
								
								
									
										377
									
								
								goecs.sh
									
									
									
									
									
								
							
							
						
						
									
										377
									
								
								goecs.sh
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| #!/bin/bash | ||||
| #!/bin/sh | ||||
| # From https://github.com/oneclickvirt/ecs | ||||
| # 2025.06.29 | ||||
| # 2025.10.08 | ||||
|  | ||||
| # curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh | ||||
| # 或 | ||||
| @@ -20,22 +20,27 @@ cd /root >/dev/null 2>&1 | ||||
| if [ ! -d "/usr/bin/" ]; then | ||||
|     mkdir -p "/usr/bin/" | ||||
| fi | ||||
| _red() { echo -e "\033[31m\033[01m$@\033[0m"; } | ||||
| _green() { echo -e "\033[32m\033[01m$@\033[0m"; } | ||||
| _yellow() { echo -e "\033[33m\033[01m$@\033[0m"; } | ||||
| _blue() { echo -e "\033[36m\033[01m$@\033[0m"; } | ||||
| reading() { read -rp "$(_green "$1")" "$2"; } | ||||
| _red() { printf "\033[31m\033[01m%s\033[0m\n" "$*"; } | ||||
| _green() { printf "\033[32m\033[01m%s\033[0m\n" "$*"; } | ||||
| _yellow() { printf "\033[33m\033[01m%s\033[0m\n" "$*"; } | ||||
| _blue() { printf "\033[36m\033[01m%s\033[0m\n" "$*"; } | ||||
| reading() {  | ||||
|     printf "\033[32m\033[01m%s\033[0m" "$1" | ||||
|     read "$2" | ||||
| } | ||||
|  | ||||
| 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 | ||||
|     local o_url="$1" | ||||
|     local cdn_url | ||||
|     for cdn_url in $cdn_urls; do | ||||
|         if curl -4 -sL -k "$cdn_url$o_url" --max-time 6 | grep -q "success" >/dev/null 2>&1; then | ||||
|             cdn_success_url="$cdn_url" | ||||
|             return 0 | ||||
|         fi | ||||
|         sleep 0.5 | ||||
|     done | ||||
|     export cdn_success_url="" | ||||
|     cdn_success_url="" | ||||
|     return 1 | ||||
| } | ||||
|  | ||||
| check_cdn_file() { | ||||
| @@ -50,9 +55,9 @@ check_cdn_file() { | ||||
| download_file() { | ||||
|     local url="$1" | ||||
|     local output="$2" | ||||
|     if ! wget -O "$output" "$url"; then | ||||
|     if ! wget -O "$output" "$url" 2>/dev/null; then | ||||
|         _yellow "wget failed, trying curl..." | ||||
|         if ! curl -L -o "$output" "$url"; then | ||||
|         if ! curl -L -o "$output" "$url" 2>/dev/null; then | ||||
|             _red "Both wget and curl failed. Unable to download the file." | ||||
|             return 1 | ||||
|         fi | ||||
| @@ -62,8 +67,7 @@ download_file() { | ||||
|  | ||||
| check_china() { | ||||
|     _yellow "正在检测IP所在区域......" | ||||
|     if [[ -z "${CN}" ]]; then | ||||
|         # 首先尝试通过 ipapi.co 检测 | ||||
|     if [ -z "${CN}" ]; then | ||||
|         if curl -m 6 -s https://ipapi.co/json | grep -q 'China'; then | ||||
|             _yellow "根据ipapi.co提供的信息,当前IP可能在中国" | ||||
|             if [ "$noninteractive" != "true" ]; then | ||||
| @@ -94,28 +98,33 @@ check_china() { | ||||
|  | ||||
| get_memory_size() { | ||||
|     if [ -f /proc/meminfo ]; then | ||||
|         local mem_kb=$(grep MemTotal /proc/meminfo | awk '{print $2}') | ||||
|         local mem_kb | ||||
|         mem_kb=$(grep MemTotal /proc/meminfo | awk '{print $2}') | ||||
|         echo $((mem_kb / 1024)) # Convert to MB | ||||
|         return | ||||
|         return 0 | ||||
|     fi | ||||
|     if command -v free >/dev/null 2>&1; then | ||||
|         local mem_kb=$(free -m | awk '/^Mem:/ {print $2}') | ||||
|         local mem_kb | ||||
|         mem_kb=$(free -m | awk '/^Mem:/ {print $2}') | ||||
|         echo "$mem_kb" # Already in MB | ||||
|         return | ||||
|         return 0 | ||||
|     fi | ||||
|     if command -v sysctl >/dev/null 2>&1; then | ||||
|         local mem_bytes=$(sysctl -n hw.memsize 2>/dev/null || sysctl -n hw.physmem 2>/dev/null) | ||||
|         local mem_bytes | ||||
|         mem_bytes=$(sysctl -n hw.memsize 2>/dev/null || sysctl -n hw.physmem 2>/dev/null) | ||||
|         if [ -n "$mem_bytes" ]; then | ||||
|             echo $((mem_bytes / 1024 / 1024)) # Convert to MB | ||||
|             return | ||||
|             return 0 | ||||
|         fi | ||||
|     fi | ||||
|     echo 0 | ||||
|     return 1 | ||||
| } | ||||
|  | ||||
| cleanup_epel() { | ||||
|     _yellow "Cleaning up EPEL repositories..." | ||||
|     rm -f /etc/yum.repos.d/*epel* | ||||
|     yum clean all | ||||
|     yum clean all >/dev/null 2>&1 | ||||
| } | ||||
|  | ||||
| goecs_check() { | ||||
| @@ -143,7 +152,7 @@ goecs_check() { | ||||
|     os=$(uname -s 2>/dev/null || echo "Unknown") | ||||
|     arch=$(uname -m 2>/dev/null || echo "Unknown") | ||||
|     check_china | ||||
|     ECS_VERSION="0.1.77" | ||||
|     ECS_VERSION="0.1.91" | ||||
|     for api in \ | ||||
|         "https://api.github.com/repos/oneclickvirt/ecs/releases/latest" \ | ||||
|         "https://githubapi.spiritlhl.workers.dev/repos/oneclickvirt/ecs/releases/latest" \ | ||||
| @@ -155,23 +164,24 @@ goecs_check() { | ||||
|         sleep 1 | ||||
|     done | ||||
|     if [ -z "$ECS_VERSION" ]; then | ||||
|         _yellow "Unable to get version info, using default version 0.1.77" | ||||
|         ECS_VERSION="0.1.77" | ||||
|         _yellow "Unable to get version info, using default version 0.1.91" | ||||
|         ECS_VERSION="0.1.91" | ||||
|     fi | ||||
|     version_output="" | ||||
|     for cmd_path in "goecs" "./goecs" "/usr/bin/goecs" "/usr/local/bin/goecs"; do | ||||
|         if [ -x "$(command -v $cmd_path 2>/dev/null)" ]; then | ||||
|         if command -v "$cmd_path" >/dev/null 2>&1; then | ||||
|             version_output=$($cmd_path -v command 2>/dev/null) | ||||
|             break | ||||
|         fi | ||||
|     done | ||||
|     if [ -n "$version_output" ]; then | ||||
|         extracted_version=${version_output//v/} | ||||
|         extracted_version=${version_output#*v} | ||||
|         extracted_version=${extracted_version#v} | ||||
|         if [ -n "$extracted_version" ]; then | ||||
|             ecs_version=$ECS_VERSION | ||||
|             if [[ "$(echo -e "$extracted_version\n$ecs_version" | sort -V | tail -n 1)" == "$extracted_version" ]]; then | ||||
|             if [ "$(printf '%s\n%s\n' "$extracted_version" "$ecs_version" | sort -V | tail -n 1)" = "$extracted_version" ]; then | ||||
|                 _green "goecs version ($extracted_version) is up to date, no upgrade needed" | ||||
|                 return | ||||
|                 return 0 | ||||
|             else | ||||
|                 _yellow "goecs version ($extracted_version) < $ecs_version, upgrade needed, starting in 5 seconds" | ||||
|                 rm -rf /usr/bin/goecs /usr/local/bin/goecs ./goecs | ||||
| @@ -181,11 +191,11 @@ goecs_check() { | ||||
|         _green "goecs not found, installation needed, starting in 5 seconds" | ||||
|     fi | ||||
|     sleep 5 | ||||
|     if [[ "$CN" == true ]]; then | ||||
|     if [ "$CN" = "true" ]; then | ||||
|         _yellow "Using China mirror for download..." | ||||
|         base_url="https://cnb.cool/oneclickvirt/ecs/-/git/raw/main" | ||||
|     else | ||||
|         cdn_urls=("https://cdn0.spiritlhl.top/" "http://cdn3.spiritlhl.net/" "http://cdn1.spiritlhl.net/" "http://cdn2.spiritlhl.net/") | ||||
|         cdn_urls="https://cdn0.spiritlhl.top/ http://cdn3.spiritlhl.net/ http://cdn1.spiritlhl.net/ http://cdn2.spiritlhl.net/" | ||||
|         check_cdn_file | ||||
|         if [ -n "$cdn_success_url" ]; then | ||||
|             base_url="${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}" | ||||
| @@ -301,169 +311,188 @@ InstallSysbench() { | ||||
|     else | ||||
|         Var_OSRelease="unknown" # 未知系统分支 | ||||
|     fi | ||||
|     local mem_size=$(get_memory_size) | ||||
|     local mem_size | ||||
|     mem_size=$(get_memory_size) | ||||
|     if [ -z "$mem_size" ] || [ "$mem_size" -eq 0 ]; then | ||||
|         echo "Error: Unable to determine memory size or memory size is zero." | ||||
|     elif [ $mem_size -lt 1024 ]; then | ||||
|     elif [ "$mem_size" -lt 1024 ]; then | ||||
|         _red "Warning: Your system has less than 1GB RAM (${mem_size}MB)" | ||||
|         if [ "$noninteractive" != "true" ]; then | ||||
|             reading "Do you want to continue with EPEL installation? (y/N): " confirm | ||||
|             if [[ ! $confirm =~ ^[Yy]$ ]]; then | ||||
|                 _yellow "Skipping EPEL installation" | ||||
|                 return 1 | ||||
|             fi | ||||
|             case "$confirm" in | ||||
|                 [Yy]*) | ||||
|                     ;; | ||||
|                 *) | ||||
|                     _yellow "Skipping EPEL installation" | ||||
|                     return 1 | ||||
|                     ;; | ||||
|             esac | ||||
|         fi | ||||
|         case "$Var_OSRelease" in | ||||
|         ubuntu | debian | astra) | ||||
|             ! apt-get install -y sysbench && apt-get --fix-broken install -y && apt-get install --no-install-recommends -y sysbench ;; | ||||
|             if ! apt-get install -y sysbench; then | ||||
|                 apt-get --fix-broken install -y | ||||
|                 apt-get install --no-install-recommends -y sysbench | ||||
|             fi | ||||
|             ;; | ||||
|         centos | rhel | almalinux | redhat | opencloudos) | ||||
|             (yum -y install epel-release && yum -y install sysbench) || (dnf install epel-release -y && dnf install sysbench -y) ;; | ||||
|             if ! yum -y install epel-release || ! yum -y install sysbench; then | ||||
|                 if command -v dnf >/dev/null 2>&1; then | ||||
|                     dnf install epel-release -y | ||||
|                     dnf install sysbench -y | ||||
|                 fi | ||||
|             fi | ||||
|             ;; | ||||
|         fedora) | ||||
|             dnf -y install sysbench ;; | ||||
|         arch) | ||||
|             pacman -S --needed --noconfirm sysbench && pacman -S --needed --noconfirm libaio && ldconfig ;; | ||||
|             pacman -S --needed --noconfirm sysbench | ||||
|             pacman -S --needed --noconfirm libaio | ||||
|             ldconfig | ||||
|             ;; | ||||
|         freebsd) | ||||
|             pkg install -y sysbench ;; | ||||
|         alpinelinux) | ||||
|             if [ "$noninteractive" != "true" ]; then | ||||
|                 reading "Do you want to continue with sysbench installation? (y/N): " confirm | ||||
|                 if [[ ! $confirm =~ ^[Yy]$ ]]; then | ||||
|                     _yellow "Skipping sysbench installation" | ||||
|                     return 1 | ||||
|                 fi | ||||
|                 case "$confirm" in | ||||
|                     [Yy]*) | ||||
|                         ;; | ||||
|                     *) | ||||
|                         _yellow "Skipping sysbench installation" | ||||
|                         return 1 | ||||
|                         ;; | ||||
|                 esac | ||||
|             fi | ||||
|             ALPINE_VERSION=$(grep -o '^[0-9]\+\.[0-9]\+' /etc/alpine-release) | ||||
|             COMMUNITY_REPO="http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community" | ||||
|             if grep -q "^${COMMUNITY_REPO}" /etc/apk/repositories; then | ||||
|                 echo "Community repository is already enabled." | ||||
|             else | ||||
|             if ! grep -q "^${COMMUNITY_REPO}" /etc/apk/repositories; then | ||||
|                 echo "Enabling community repository..." | ||||
|                 echo "${COMMUNITY_REPO}" >> /etc/apk/repositories | ||||
|                 echo "Community repository has been added." | ||||
|                 echo "Updating apk package index..." | ||||
|                 apk update && echo "Package index updated successfully." | ||||
|             else | ||||
|                 echo "Community repository is already enabled." | ||||
|             fi | ||||
|             if apk info sysbench >/dev/null 2>&1; then | ||||
|                 echo -e "${Msg_Info}Sysbench already installed." | ||||
|                 echo "Sysbench already installed." | ||||
|             else | ||||
|                 apk add --no-cache sysbench | ||||
|                 if [ $? -ne 0 ]; then | ||||
|                     echo -e "${Msg_Warning}Sysbench Module not found, installing ..." && echo -e "${Msg_Warning}SysBench Current not support Alpine Linux, Skipping..." && Var_Skip_SysBench="1" | ||||
|                 if ! apk add --no-cache sysbench; then | ||||
|                     echo "Sysbench Module not found, installing ..." | ||||
|                     echo "SysBench Current not support Alpine Linux, Skipping..." | ||||
|                     Var_Skip_SysBench="1" | ||||
|                 else | ||||
|                     echo -e "${Msg_Success}Sysbench installed successfully." | ||||
|                     echo "Sysbench installed successfully." | ||||
|                 fi | ||||
|             fi ;; | ||||
|             fi | ||||
|             ;; | ||||
|         *) | ||||
|             _red "Sysbench Install Error: Unknown OS release: $Var_OSRelease" ;; | ||||
|         esac | ||||
|         if [[ $SYSTEM =~ ^(CentOS|RHEL|AlmaLinux)$ ]]; then | ||||
|         _yellow "Installing EPEL repository..." | ||||
|             if ! yum -y install epel-release; then | ||||
|                 _red "EPEL installation failed!" | ||||
|                 cleanup_epel | ||||
|                 _yellow "Attempting to continue without EPEL..." | ||||
|             fi | ||||
|         fi | ||||
|     fi | ||||
| } | ||||
|  | ||||
| Check_SysBench() { | ||||
|     if [ ! -f "/usr/bin/sysbench" ] && [ ! -f "/usr/local/bin/sysbench" ]; then | ||||
|         InstallSysbench | ||||
|     fi | ||||
|     # 尝试编译安装 | ||||
|     if [ ! -f "/usr/bin/sysbench" ] && [ ! -f "/usr/local/bin/sysbench" ]; then | ||||
|         echo -e "${Msg_Warning}Sysbench Module install Failure, trying compile modules ..." | ||||
|         Check_Sysbench_InstantBuild | ||||
|     fi | ||||
|     source ~/.bashrc | ||||
|     # 最终检测 | ||||
|     if [ "$(command -v sysbench)" ] || [ -f "/usr/bin/sysbench" ] || [ -f "/usr/local/bin/sysbench" ]; then | ||||
|         _yellow "Install sysbench successfully!" | ||||
|     else | ||||
|         _red "SysBench Moudle install Failure! Try Restart Bench or Manually install it! (/usr/bin/sysbench)" | ||||
|         _blue "Will try to test with geekbench5 instead later." | ||||
|     fi | ||||
|     sleep 3 | ||||
| } | ||||
|  | ||||
| Check_Sysbench_InstantBuild() { | ||||
|     if [ "${Var_OSRelease}" = "centos" ] || [ "${Var_OSRelease}" = "rhel" ] || [ "${Var_OSRelease}" = "almalinux" ] || [ "${Var_OSRelease}" = "ubuntu" ] || [ "${Var_OSRelease}" = "debian" ] || [ "${Var_OSRelease}" = "fedora" ] || [ "${Var_OSRelease}" = "arch" ] || [ "${Var_OSRelease}" = "astra" ]; then | ||||
|         local os_sysbench=${Var_OSRelease} | ||||
|         if [ "$os_sysbench" = "astra" ]; then | ||||
|             os_sysbench="debian" | ||||
|         fi | ||||
|         if [ "$os_sysbench" = "opencloudos" ]; then | ||||
|             os_sysbench="centos" | ||||
|         fi | ||||
|         echo -e "${Msg_Info}Release Detected: ${os_sysbench}" | ||||
|         echo -e "${Msg_Info}Preparing compile enviorment ..." | ||||
|         prepare_compile_env "${os_sysbench}" | ||||
|         echo -e "${Msg_Info}Downloading Source code (Version 1.0.20)..." | ||||
|         mkdir -p /tmp/sysbench_install/src/ | ||||
|         mv /tmp/sysbench-1.0.20 /tmp/sysbench_install/src/ | ||||
|         echo -e "${Msg_Info}Compiling Sysbench Module ..." | ||||
|         cd /tmp/sysbench_install/src/sysbench-1.0.20 | ||||
|         ./autogen.sh && ./configure --without-mysql && make -j8 && make install | ||||
|         echo -e "${Msg_Info}Cleaning up ..." | ||||
|         cd /tmp && rm -rf /tmp/sysbench_install/src/sysbench* | ||||
|     else | ||||
|         echo -e "${Msg_Warning}Unsupported operating system: ${Var_OSRelease}" | ||||
|     fi | ||||
| } | ||||
|  | ||||
| prepare_compile_env() { | ||||
|     local system="$1" | ||||
|     if [ "${system}" = "centos" ] || [ "${system}" = "rhel" ] || [ "${system}" = "almalinux" ]; then | ||||
|         yum install -y epel-release | ||||
|         yum install -y wget curl make gcc gcc-c++ make automake libtool pkgconfig libaio-devel | ||||
|     elif [ "${system}" = "ubuntu" ] || [ "${system}" = "debian" ]; then | ||||
|         ! apt-get update && apt-get --fix-broken install -y && apt-get update | ||||
|         ! apt-get -y install --no-install-recommends curl wget make automake libtool pkg-config libaio-dev unzip && apt-get --fix-broken install -y && apt-get -y install --no-install-recommends curl wget make automake libtool pkg-config libaio-dev unzip | ||||
|     elif [ "${system}" = "fedora" ]; then | ||||
|         dnf install -y wget curl gcc gcc-c++ make automake libtool pkgconfig libaio-devel | ||||
|     elif [ "${system}" = "arch" ]; then | ||||
|         pacman -S --needed --noconfirm wget curl gcc gcc make automake libtool pkgconfig libaio lib32-libaio | ||||
|     else | ||||
|         echo -e "${Msg_Warning}Unsupported operating system: ${system}" | ||||
|         case "$SYSTEM" in | ||||
|             CentOS|RHEL|AlmaLinux) | ||||
|                 _yellow "Installing EPEL repository..." | ||||
|                 if ! yum -y install epel-release; then | ||||
|                     _red "EPEL installation failed!" | ||||
|                     cleanup_epel | ||||
|                     _yellow "Attempting to continue without EPEL..." | ||||
|                 fi | ||||
|                 ;; | ||||
|         esac | ||||
|     fi | ||||
| } | ||||
|  | ||||
| env_check() { | ||||
|     REGEX=("debian|astra" "ubuntu" "centos|red hat|kernel|oracle linux|alma|rocky" "'amazon linux'" "fedora" "arch" "freebsd" "alpine" "openbsd" "opencloudos") | ||||
|     RELEASE=("Debian" "Ubuntu" "CentOS" "CentOS" "Fedora" "Arch" "FreeBSD" "Alpine" "OpenBSD" "OpenCloudOS") | ||||
|     PACKAGE_UPDATE=("apt-get update" "apt-get update" "yum -y update" "yum -y update" "yum -y update" "pacman -Sy" "pkg update" "apk update" "pkg_add -qu" "yum -y update") | ||||
|     PACKAGE_INSTALL=("apt-get -y install" "apt-get -y install" "yum -y install" "yum -y install" "yum -y install" "pacman -Sy --noconfirm --needed" "pkg install -y" "apk add --no-cache" "pkg_add -I" "yum -y install") | ||||
|     PACKAGE_REMOVE=("apt-get -y remove" "apt-get -y remove" "yum -y remove" "yum -y remove" "yum -y remove" "pacman -Rsc --noconfirm" "pkg delete" "apk del" "pkg_delete -I" "yum -y remove") | ||||
|     PACKAGE_UNINSTALL=("apt-get -y autoremove" "apt-get -y autoremove" "yum -y autoremove" "yum -y autoremove" "yum -y autoremove" "pacman -Rns --noconfirm" "pkg autoremove" "apk autoremove" "pkg_delete -a" "yum -y autoremove") | ||||
|     # 检测是否为 macOS 系统 | ||||
|     if [ "$(uname -s)" = "Darwin" ]; then | ||||
|         _green "Detected macOS system" | ||||
|         _green "macOS has built-in tools, skipping dependency installation" | ||||
|         _green "Environment preparation complete." | ||||
|         _green "Next command is: ./goecs.sh install" | ||||
|         return 0 | ||||
|     fi | ||||
|      | ||||
|     if [ -f /etc/opencloudos-release ]; then | ||||
|         SYS="opencloudos" | ||||
|     elif [ -s /etc/os-release ]; then | ||||
|         SYS="$(grep -i pretty_name /etc/os-release | cut -d \" -f2)" | ||||
|     elif [ -x "$(type -p hostnamectl)" ]; then | ||||
|         SYS="$(hostnamectl | grep -i system | cut -d : -f2 | xargs)" | ||||
|     elif [ -x "$(type -p lsb_release)" ]; then | ||||
|     elif command -v hostnamectl >/dev/null 2>&1; then | ||||
|         SYS="$(hostnamectl | grep -i system | cut -d : -f2 | sed 's/^ *//')" | ||||
|     elif command -v lsb_release >/dev/null 2>&1; then | ||||
|         SYS="$(lsb_release -sd)" | ||||
|     elif [ -s /etc/lsb-release ]; then | ||||
|         SYS="$(grep -i description /etc/lsb-release | cut -d \" -f2)" | ||||
|     elif [ -s /etc/redhat-release ]; then | ||||
|         SYS="$(grep . /etc/redhat-release)" | ||||
|         SYS="$(cat /etc/redhat-release)" | ||||
|     elif [ -s /etc/issue ]; then | ||||
|         SYS="$(grep . /etc/issue | cut -d '\' -f1 | sed '/^[ ]*$/d')" | ||||
|         SYS="$(head -n1 /etc/issue | cut -d '\' -f1 | sed '/^[ ]*$/d')" | ||||
|     else | ||||
|         SYS="$(uname -s)" | ||||
|     fi | ||||
|     SYSTEM="" | ||||
|     for ((int = 0; int < ${#REGEX[@]}; int++)); do | ||||
|         if [[ $(echo "$SYS" | tr '[:upper:]' '[:lower:]') =~ ${REGEX[int]} ]]; then | ||||
|             SYSTEM="${RELEASE[int]}" | ||||
|             UPDATE_CMD=${PACKAGE_UPDATE[int]} | ||||
|             INSTALL_CMD=${PACKAGE_INSTALL[int]} | ||||
|             REMOVE_CMD=${PACKAGE_REMOVE[int]} | ||||
|             UNINSTALL_CMD=${PACKAGE_UNINSTALL[int]} | ||||
|             break | ||||
|         fi | ||||
|     done | ||||
|     sys_lower=$(echo "$SYS" | tr '[:upper:]' '[:lower:]') | ||||
|     if echo "$sys_lower" | grep -E "debian|astra" >/dev/null 2>&1; then | ||||
|         SYSTEM="Debian" | ||||
|         UPDATE_CMD="apt-get update" | ||||
|         INSTALL_CMD="apt-get -y install" | ||||
|         REMOVE_CMD="apt-get -y remove" | ||||
|         UNINSTALL_CMD="apt-get -y autoremove" | ||||
|     elif echo "$sys_lower" | grep -E "ubuntu" >/dev/null 2>&1; then | ||||
|         SYSTEM="Ubuntu" | ||||
|         UPDATE_CMD="apt-get update" | ||||
|         INSTALL_CMD="apt-get -y install" | ||||
|         REMOVE_CMD="apt-get -y remove" | ||||
|         UNINSTALL_CMD="apt-get -y autoremove" | ||||
|     elif echo "$sys_lower" | grep -E "centos|red hat|kernel|oracle linux|alma|rocky" >/dev/null 2>&1; then | ||||
|         SYSTEM="CentOS" | ||||
|         UPDATE_CMD="yum -y update" | ||||
|         INSTALL_CMD="yum -y install" | ||||
|         REMOVE_CMD="yum -y remove" | ||||
|         UNINSTALL_CMD="yum -y autoremove" | ||||
|     elif echo "$sys_lower" | grep -E "amazon linux" >/dev/null 2>&1; then | ||||
|         SYSTEM="CentOS" | ||||
|         UPDATE_CMD="yum -y update" | ||||
|         INSTALL_CMD="yum -y install" | ||||
|         REMOVE_CMD="yum -y remove" | ||||
|         UNINSTALL_CMD="yum -y autoremove" | ||||
|     elif echo "$sys_lower" | grep -E "fedora" >/dev/null 2>&1; then | ||||
|         SYSTEM="Fedora" | ||||
|         UPDATE_CMD="yum -y update" | ||||
|         INSTALL_CMD="yum -y install" | ||||
|         REMOVE_CMD="yum -y remove" | ||||
|         UNINSTALL_CMD="yum -y autoremove" | ||||
|     elif echo "$sys_lower" | grep -E "arch" >/dev/null 2>&1; then | ||||
|         SYSTEM="Arch" | ||||
|         UPDATE_CMD="pacman -Sy" | ||||
|         INSTALL_CMD="pacman -Sy --noconfirm --needed" | ||||
|         REMOVE_CMD="pacman -Rsc --noconfirm" | ||||
|         UNINSTALL_CMD="pacman -Rns --noconfirm" | ||||
|     elif echo "$sys_lower" | grep -E "freebsd" >/dev/null 2>&1; then | ||||
|         SYSTEM="FreeBSD" | ||||
|         UPDATE_CMD="pkg update" | ||||
|         INSTALL_CMD="pkg install -y" | ||||
|         REMOVE_CMD="pkg delete" | ||||
|         UNINSTALL_CMD="pkg autoremove" | ||||
|     elif echo "$sys_lower" | grep -E "alpine" >/dev/null 2>&1; then | ||||
|         SYSTEM="Alpine" | ||||
|         UPDATE_CMD="apk update" | ||||
|         INSTALL_CMD="apk add --no-cache" | ||||
|         REMOVE_CMD="apk del" | ||||
|         UNINSTALL_CMD="apk autoremove" | ||||
|     elif echo "$sys_lower" | grep -E "openbsd" >/dev/null 2>&1; then | ||||
|         SYSTEM="OpenBSD" | ||||
|         UPDATE_CMD="pkg_add -qu" | ||||
|         INSTALL_CMD="pkg_add -I" | ||||
|         REMOVE_CMD="pkg_delete -I" | ||||
|         UNINSTALL_CMD="pkg_delete -a" | ||||
|     elif echo "$sys_lower" | grep -E "opencloudos" >/dev/null 2>&1; then | ||||
|         SYSTEM="OpenCloudOS" | ||||
|         UPDATE_CMD="yum -y update" | ||||
|         INSTALL_CMD="yum -y install" | ||||
|         REMOVE_CMD="yum -y remove" | ||||
|         UNINSTALL_CMD="yum -y autoremove" | ||||
|     fi | ||||
|     if [ -z "$SYSTEM" ]; then | ||||
|         _yellow "Unable to recognize system, trying common package managers..." | ||||
|         if command -v apt-get >/dev/null 2>&1; then | ||||
| @@ -510,7 +539,7 @@ env_check() { | ||||
|     _green "System information: $SYSTEM" | ||||
|     _green "Update command: $UPDATE_CMD" | ||||
|     _green "Install command: $INSTALL_CMD" | ||||
|     cdn_urls=("https://cdn0.spiritlhl.top/" "http://cdn3.spiritlhl.net/" "http://cdn1.spiritlhl.net/" "http://cdn2.spiritlhl.net/") | ||||
|     cdn_urls="https://cdn0.spiritlhl.top/ http://cdn3.spiritlhl.net/ http://cdn1.spiritlhl.net/ http://cdn2.spiritlhl.net/" | ||||
|     check_cdn_file | ||||
|     _yellow "Warning: System update will be performed" | ||||
|     _yellow "This operation may:" | ||||
| @@ -520,15 +549,18 @@ env_check() { | ||||
|     _yellow "4. Affect subsequent system startups" | ||||
|     if [ "$noninteractive" != "true" ]; then | ||||
|         reading "Continue with system update? (y/N): " update_confirm | ||||
|         if [[ ! $update_confirm =~ ^[Yy]$ ]]; then | ||||
|             _yellow "Skipping system update" | ||||
|             _yellow "Note: Some packages may fail to install" | ||||
|         else | ||||
|             _green "Updating system package manager..." | ||||
|             if ! ${UPDATE_CMD} 2>/dev/null; then | ||||
|                 _red "System update failed!" | ||||
|             fi | ||||
|         fi | ||||
|         case "$update_confirm" in | ||||
|             [Yy]*) | ||||
|                 _green "Updating system package manager..." | ||||
|                 if ! ${UPDATE_CMD} 2>/dev/null; then | ||||
|                     _red "System update failed!" | ||||
|                 fi | ||||
|                 ;; | ||||
|             *) | ||||
|                 _yellow "Skipping system update" | ||||
|                 _yellow "Note: Some packages may fail to install" | ||||
|                 ;; | ||||
|         esac | ||||
|     fi | ||||
|     for cmd in sudo wget tar unzip iproute2 systemd-detect-virt dd fio; do | ||||
|         if ! command -v "$cmd" >/dev/null 2>&1; then | ||||
| @@ -538,44 +570,31 @@ env_check() { | ||||
|     done | ||||
|     if ! command -v sysbench >/dev/null 2>&1; then | ||||
|         _green "Installing sysbench" | ||||
|         ${INSTALL_CMD} sysbench | ||||
|         if [ $? -ne 0 ]; then | ||||
|             echo "Unable to download sysbench through package manager, attempting compilation..." | ||||
|             wget -O /tmp/sysbench.zip "${cdn_success_url}https://github.com/akopytov/sysbench/archive/1.0.20.zip" || curl -Lk -o /tmp/sysbench.zip "${cdn_success_url}https://github.com/akopytov/sysbench/archive/1.0.20.zip" | ||||
|             if [ ! -f /tmp/sysbench.zip ]; then | ||||
|                 wget -q -O /tmp/sysbench.zip "https://hub.fgit.cf/akopytov/sysbench/archive/1.0.20.zip" | ||||
|             fi | ||||
|             chmod +x /tmp/sysbench.zip | ||||
|             unzip /tmp/sysbench.zip -d /tmp | ||||
|             Check_SysBench | ||||
|         if ! ${INSTALL_CMD} sysbench; then | ||||
|             _red "Unable to install sysbench through package manager" | ||||
|             _yellow "Sysbench installation skipped" | ||||
|         fi | ||||
|     fi | ||||
|     if ! command -v geekbench >/dev/null 2>&1; then | ||||
|         _green "Installing geekbench" | ||||
|         curl -L "${cdn_success_url}https://raw.githubusercontent.com/oneclickvirt/cputest/main/dgb.sh" -o dgb.sh && chmod +x dgb.sh | ||||
|         bash dgb.sh -v gb5 | ||||
|         sh dgb.sh -v gb5 | ||||
|         rm -rf dgb.sh | ||||
|     fi | ||||
|     if ! command -v speedtest >/dev/null 2>&1; then | ||||
|         _green "Installing speedtest" | ||||
|         curl -L "${cdn_success_url}https://raw.githubusercontent.com/oneclickvirt/speedtest/main/dspt.sh" -o dspt.sh && chmod +x dspt.sh | ||||
|         bash dspt.sh | ||||
|         sh dspt.sh | ||||
|         rm -rf dspt.sh | ||||
|         rm -rf speedtest.tar.gz | ||||
|     fi | ||||
|     if ! command -v ping >/dev/null 2>&1; then | ||||
|         _green "Installing ping" | ||||
|         ${INSTALL_CMD} iputils-ping >/dev/null 2>&1 | ||||
|         ${INSTALL_CMD} ping >/dev/null 2>&1 | ||||
|         ${INSTALL_CMD} iputils-ping >/dev/null 2>&1 || ${INSTALL_CMD} ping >/dev/null 2>&1 | ||||
|     fi | ||||
|     if [ "$(uname -s)" = "Darwin" ]; then | ||||
|         echo "Detected MacOS, installing sysbench iproute2mac..." | ||||
|         brew install --force sysbench iproute2mac | ||||
|     else | ||||
|         if ! grep -q "^net.ipv4.ping_group_range = 0 2147483647$" /etc/sysctl.conf; then | ||||
|             echo "net.ipv4.ping_group_range = 0 2147483647" >> /etc/sysctl.conf | ||||
|             sysctl -p | ||||
|         fi | ||||
|     if ! grep -q "^net.ipv4.ping_group_range = 0 2147483647$" /etc/sysctl.conf 2>/dev/null; then | ||||
|         echo "net.ipv4.ping_group_range = 0 2147483647" >> /etc/sysctl.conf 2>/dev/null | ||||
|         sysctl -p >/dev/null 2>&1 | ||||
|     fi | ||||
|     _green "Environment preparation complete." | ||||
|     _green "Next command is: ./goecs.sh install" | ||||
| @@ -592,6 +611,7 @@ show_help() { | ||||
| 可用命令: | ||||
|  | ||||
| ./goecs.sh env            检查并安装依赖包 | ||||
|                           注意: macOS系统会自动跳过依赖安装 | ||||
|                           警告: 此命令会执行系统更新(可选择),可能: | ||||
|                           1. 耗时较长 | ||||
|                           2. 导致网络短暂中断 | ||||
| @@ -619,6 +639,7 @@ show_help() { | ||||
| Available commands: | ||||
|  | ||||
| ./goecs.sh env             Check and Install dependencies | ||||
|                            Note: macOS systems will skip dependency installation | ||||
|                            Warning: This command performs system update(optional), which may: | ||||
|                            1. Take considerable time | ||||
|                            2. Cause temporary network interruptions | ||||
|   | ||||
| @@ -8,27 +8,78 @@ import ( | ||||
| ) | ||||
|  | ||||
| func MemoryTest(language, testMethod string) (realTestMethod, res string) { | ||||
| 	testMethod = strings.ToLower(testMethod) | ||||
| 	if testMethod == "" { | ||||
| 		testMethod = "auto" | ||||
| 	} | ||||
| 	if runtime.GOOS == "windows" { | ||||
| 		if testMethod != "winsat" && testMethod != "" { | ||||
| 		switch testMethod { | ||||
| 		case "stream": | ||||
| 			res = memory.WinsatTest(language) | ||||
| 			realTestMethod = "winsat" | ||||
| 		case "dd": | ||||
| 			res = memory.WindowsDDTest(language) | ||||
| 			if res == "" || strings.TrimSpace(res) == "" { | ||||
| 				res += memory.WinsatTest(language) | ||||
| 				realTestMethod = "winsat" | ||||
| 			} else { | ||||
| 				realTestMethod = "dd" | ||||
| 			} | ||||
| 		case "sysbench": | ||||
| 			res = memory.WinsatTest(language) | ||||
| 			realTestMethod = "winsat" | ||||
| 		case "auto", "winsat": | ||||
| 			res = memory.WinsatTest(language) | ||||
| 			realTestMethod = "winsat" | ||||
| 		default: | ||||
| 			res = memory.WinsatTest(language) | ||||
| 			realTestMethod = "winsat" | ||||
| 		} | ||||
| 		res += memory.WinsatTest(language) | ||||
| 	} else { | ||||
| 		switch testMethod { | ||||
| 		case "stream": | ||||
| 			res = memory.StreamTest(language) | ||||
| 			if res == "" || strings.TrimSpace(res) == "" { | ||||
| 				res += memory.DDTest(language) | ||||
| 				realTestMethod = "dd" | ||||
| 			} else { | ||||
| 				realTestMethod = "stream" | ||||
| 			} | ||||
| 		case "dd": | ||||
| 			res = memory.DDTest(language) | ||||
| 			realTestMethod = "dd" | ||||
| 		case "sysbench": | ||||
| 			res = memory.SysBenchTest(language) | ||||
| 			if res == "" { | ||||
| 			if res == "" || strings.TrimSpace(res) == "" { | ||||
| 				res += memory.DDTest(language) | ||||
| 				realTestMethod = "dd" | ||||
| 			} else { | ||||
| 				realTestMethod = "sysbench" | ||||
| 			} | ||||
| 		case "dd": | ||||
| 		case "auto": | ||||
| 			res = memory.StreamTest(language) | ||||
| 			if res == "" || strings.TrimSpace(res) == "" { | ||||
| 				res = memory.DDTest(language) | ||||
| 				if res == "" || strings.TrimSpace(res) == "" { | ||||
| 					res = memory.SysBenchTest(language) | ||||
| 					if res == "" || strings.TrimSpace(res) == "" { | ||||
| 						realTestMethod = "" | ||||
| 					} else { | ||||
| 						realTestMethod = "sysbench" | ||||
| 					} | ||||
| 				} else { | ||||
| 					realTestMethod = "dd" | ||||
| 				} | ||||
| 			} else { | ||||
| 				realTestMethod = "stream" | ||||
| 			} | ||||
| 		case "winsat": | ||||
| 			// winsat 仅 Windows 支持,非 Windows fallback 到 dd | ||||
| 			res = memory.DDTest(language) | ||||
| 			realTestMethod = "dd" | ||||
| 		default: | ||||
| 			res += memory.DDTest(language) | ||||
| 			realTestMethod = "dd" | ||||
| 			res = "Unsupported test method" | ||||
| 			realTestMethod = "" | ||||
| 		} | ||||
| 	} | ||||
| 	if !strings.Contains(res, "\n") && res != "" { | ||||
|   | ||||
| @@ -6,6 +6,6 @@ import ( | ||||
| ) | ||||
|  | ||||
| func Test(t *testing.T) { | ||||
| 	_, res := MemoryTest("zh", "sysbench") | ||||
| 	_, res := MemoryTest("zh", "stream") | ||||
| 	fmt.Print(res) | ||||
| } | ||||
|   | ||||
| @@ -2,24 +2,24 @@ package unlocktest | ||||
|  | ||||
| import ( | ||||
| 	"github.com/oneclickvirt/UnlockTests/utils" | ||||
| 	"github.com/oneclickvirt/UnlockTests/uts" | ||||
| 	"github.com/oneclickvirt/UnlockTests/executor" | ||||
| 	"github.com/oneclickvirt/defaultset" | ||||
| ) | ||||
|  | ||||
| func MediaTest(language string) string { | ||||
| 	var res string | ||||
| 	readStatus := uts.ReadSelect(language, "0") | ||||
| 	readStatus := executor.ReadSelect(language, "0") | ||||
| 	if !readStatus { | ||||
| 		return "" | ||||
| 	} | ||||
| 	if uts.IPV4 { | ||||
| 	if executor.IPV4 { | ||||
| 		res += defaultset.Blue("IPV4:") + "\n" | ||||
| 		res += uts.RunTests(utils.Ipv4HttpClient, "ipv4", language, false) | ||||
| 		res += executor.RunTests(utils.Ipv4HttpClient, "ipv4", language, false) | ||||
| 		return res | ||||
| 	} | ||||
| 	if uts.IPV6 { | ||||
| 	if executor.IPV6 { | ||||
| 		res += defaultset.Blue("IPV6:") + "\n" | ||||
| 		res += uts.RunTests(utils.Ipv6HttpClient, "ipv6", language, false) | ||||
| 		res += executor.RunTests(utils.Ipv6HttpClient, "ipv6", language, false) | ||||
| 		return res | ||||
| 	} | ||||
| 	return "" | ||||
|   | ||||
| @@ -5,7 +5,7 @@ import ( | ||||
| 	"sync" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/oneclickvirt/UnlockTests/uts" | ||||
| 	"github.com/oneclickvirt/UnlockTests/executor" | ||||
| 	bgptools "github.com/oneclickvirt/backtrace/bgptools" | ||||
| 	backtrace "github.com/oneclickvirt/backtrace/bk" | ||||
| 	. "github.com/oneclickvirt/defaultset" | ||||
| @@ -51,7 +51,7 @@ func UpstreamsCheck() { | ||||
| 	wg.Add(1) | ||||
| 	go func() { | ||||
| 		defer wg.Done() | ||||
| 		result := backtrace.BackTrace(uts.IPV6) | ||||
| 		result := backtrace.BackTrace(executor.IPV6) | ||||
| 		results.backtraceResult = result | ||||
| 	}() | ||||
| 	wg.Wait() | ||||
|   | ||||
| @@ -18,7 +18,7 @@ import ( | ||||
| 	"unicode/utf8" | ||||
|  | ||||
| 	"github.com/imroc/req/v3" | ||||
| 	"github.com/oneclickvirt/UnlockTests/uts" | ||||
| 	"github.com/oneclickvirt/UnlockTests/executor" | ||||
| 	bnetwork "github.com/oneclickvirt/basics/network" | ||||
| 	"github.com/oneclickvirt/basics/system" | ||||
| 	butils "github.com/oneclickvirt/basics/utils" | ||||
| @@ -56,13 +56,13 @@ func PrintHead(language string, width int, ecsVersion string) { | ||||
| 	if language == "zh" { | ||||
| 		PrintCenteredTitle("VPS融合怪测试", width) | ||||
| 		fmt.Printf("版本:%s\n", ecsVersion) | ||||
| 		fmt.Println("测评频道: https://t.me/vps_reviews\n" + | ||||
| 		fmt.Println("测评频道: https://t.me/+UHVoo2U4VyA5NTQ1\n" + | ||||
| 			"Go项目地址:https://github.com/oneclickvirt/ecs\n" + | ||||
| 			"Shell项目地址:https://github.com/spiritLHLS/ecs") | ||||
| 	} else { | ||||
| 		PrintCenteredTitle("VPS Fusion Monster Test", width) | ||||
| 		fmt.Printf("Version: %s\n", ecsVersion) | ||||
| 		fmt.Println("Review Channel: https://t.me/vps_reviews\n" + | ||||
| 		fmt.Println("Review Channel: https://t.me/+UHVoo2U4VyA5NTQ1\n" + | ||||
| 			"Go Project: https://github.com/oneclickvirt/ecs\n" + | ||||
| 			"Shell Project: https://github.com/spiritLHLS/ecs") | ||||
| 	} | ||||
| @@ -124,14 +124,14 @@ func OnlyBasicsIpInfo(language string) (string, string, string) { | ||||
| 	} | ||||
| 	basicInfo := ipInfo | ||||
| 	if strings.Contains(ipInfo, "IPV4") && strings.Contains(ipInfo, "IPV6") && ipv4 != "" && ipv6 != "" { | ||||
| 		uts.IPV4 = true | ||||
| 		uts.IPV6 = true | ||||
| 		executor.IPV4 = true | ||||
| 		executor.IPV6 = true | ||||
| 	} else if strings.Contains(ipInfo, "IPV4") && ipv4 != "" { | ||||
| 		uts.IPV4 = true | ||||
| 		uts.IPV6 = false | ||||
| 		executor.IPV4 = true | ||||
| 		executor.IPV6 = false | ||||
| 	} else if strings.Contains(ipInfo, "IPV6") && ipv6 != "" { | ||||
| 		uts.IPV6 = true | ||||
| 		uts.IPV4 = false | ||||
| 		executor.IPV6 = true | ||||
| 		executor.IPV4 = false | ||||
| 	} | ||||
| 	basicInfo = strings.ReplaceAll(basicInfo, "\n\n", "\n") | ||||
| 	return ipv4, ipv6, basicInfo | ||||
| @@ -157,20 +157,20 @@ func BasicsAndSecurityCheck(language, nt3CheckType string, securityCheckStatus b | ||||
| 	wgt.Wait() | ||||
| 	basicInfo := systemInfo + ipInfo | ||||
| 	if strings.Contains(ipInfo, "IPV4") && strings.Contains(ipInfo, "IPV6") && ipv4 != "" && ipv6 != "" { | ||||
| 		uts.IPV4 = true | ||||
| 		uts.IPV6 = true | ||||
| 		executor.IPV4 = true | ||||
| 		executor.IPV6 = true | ||||
| 		if nt3CheckType == "" { | ||||
| 			nt3CheckType = "ipv4" | ||||
| 		} | ||||
| 	} else if strings.Contains(ipInfo, "IPV4") && ipv4 != "" { | ||||
| 		uts.IPV4 = true | ||||
| 		uts.IPV6 = false | ||||
| 		executor.IPV4 = true | ||||
| 		executor.IPV6 = false | ||||
| 		if nt3CheckType == "" { | ||||
| 			nt3CheckType = "ipv4" | ||||
| 		} | ||||
| 	} else if strings.Contains(ipInfo, "IPV6") && ipv6 != "" { | ||||
| 		uts.IPV6 = true | ||||
| 		uts.IPV4 = false | ||||
| 		executor.IPV6 = true | ||||
| 		executor.IPV4 = false | ||||
| 		if nt3CheckType == "" { | ||||
| 			nt3CheckType = "ipv6" | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user