From b5fce2e16b3b65800aca066c02781d0f2decffdc Mon Sep 17 00:00:00 2001 From: spiritysdx Date: Fri, 26 Jul 2024 18:50:18 +0800 Subject: [PATCH] update --- README.md | 1 + README_EN.md | 1 + go.mod | 2 +- go.sum | 4 ++-- goecs.go | 2 +- goecs.sh | 12 ++++++++++++ 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3fd8790..6078d33 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ shell脚本的说明 geekbench (geekbench5) (仅支持 IPV4 环境,且内存大于 1GB 并需要持续联网,仅支持 amd64 和 arm64 架构。) speedtest (使用官方提供的二进制文件以获得更准确的测试结果。) ping (使用官方提供的二进制文件以获得更准确的测试结果。) + systemd-detect-virt 或 dmidecode (几乎所有类 Unix 系统都有,安装以获得更准确的测试结果。) 事实上,sysbench/geekbench 是上述依赖项中唯一必须安装的,没有它们无法测试 CPU 分数。 ./goecs.sh install 安装 goecs 命令 ./goecs.sh upgrade 升级 goecs 命令 diff --git a/README_EN.md b/README_EN.md index 3af6a64..8d1ade1 100644 --- a/README_EN.md +++ b/README_EN.md @@ -97,6 +97,7 @@ Available commands: geekbench (geekbench5)(Only support IPV4 environment, and memory greater than 1GB network detection, only support amd64 and arm64 architecture.) speedtest (Use the officially provided binaries for more accurate test results.) ping (Use the officially provided binaries for more accurate test results.) + systemd-detect-virt OR dmidecode (Almost all unix-like systems have it, for more accurate test results.) In fact, sysbench/geekbench is the only one of the above dependencies that must be installed, without which the CPU score cannot be tested. ./goecs.sh install Install goecs command ./goecs.sh upgrade Upgrade goecs command diff --git a/go.mod b/go.mod index 7e2786f..b2ca1e2 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/oneclickvirt/CommonMediaTests v0.0.4-20240704024502 github.com/oneclickvirt/UnlockTests v0.0.13-20240726021207 github.com/oneclickvirt/backtrace v0.0.4-20240702140722 - github.com/oneclickvirt/basics v0.0.6-20240706025619 + github.com/oneclickvirt/basics v0.0.6-20240726104105 github.com/oneclickvirt/cputest v0.0.8-20240702070215 github.com/oneclickvirt/defaultset v0.0.2-20240624082446 github.com/oneclickvirt/disktest v0.0.4-20240704095213 diff --git a/go.sum b/go.sum index 3873450..b3602de 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/oneclickvirt/UnlockTests v0.0.13-20240726021207 h1:pe9RKF/8QxNaxwyzLH github.com/oneclickvirt/UnlockTests v0.0.13-20240726021207/go.mod h1:HP3CvAS+AJWxxY+BVbxIOlvaQ87YOSge89vAMG52b5o= github.com/oneclickvirt/backtrace v0.0.4-20240702140722 h1:UJ/VWf+ZbhGarc9HcHMIyenpmX+b2LxkXu0hlLk3Gxs= github.com/oneclickvirt/backtrace v0.0.4-20240702140722/go.mod h1:zvsC7xY/WZqs5KL2JB967OVnuqjNbxu9bW6wXRLo5h8= -github.com/oneclickvirt/basics v0.0.6-20240706025619 h1:IVuyJY41eNAjH9rFf5FPzjegRbkDiS4os9+1YaUov4M= -github.com/oneclickvirt/basics v0.0.6-20240706025619/go.mod h1:MkFyxHrB+xuTqprJ3e4KvG0jv3IfHMbc/MPfGXI/n7U= +github.com/oneclickvirt/basics v0.0.6-20240726104105 h1:Zp6+thG0NI5UdOzWZjMCTGaNGeMDY9PyqI/QsmRjHjQ= +github.com/oneclickvirt/basics v0.0.6-20240726104105/go.mod h1:MkFyxHrB+xuTqprJ3e4KvG0jv3IfHMbc/MPfGXI/n7U= github.com/oneclickvirt/cputest v0.0.8-20240702070215 h1:CcFpyVPlQkJ6vjFP17BRuJhh/afiJhOhZ0BW+TtfVDg= github.com/oneclickvirt/cputest v0.0.8-20240702070215/go.mod h1:MmaHN9+XMntI3rLycwj8Ne31fG18IfNoa8N2utDK1CY= github.com/oneclickvirt/defaultset v0.0.2-20240624082446 h1:5Pg3mK/u/vQvSz7anu0nxzrNdELi/AcDAU1mMsmPzyc= diff --git a/goecs.go b/goecs.go index 5b814c6..a26a60b 100644 --- a/goecs.go +++ b/goecs.go @@ -38,7 +38,7 @@ import ( ) var ( - ecsVersion = "v0.0.54" + ecsVersion = "v0.0.55" menuMode bool onlyChinaTest bool input, choice string diff --git a/goecs.sh b/goecs.sh index 4e83d1b..9c7e284 100644 --- a/goecs.sh +++ b/goecs.sh @@ -308,6 +308,16 @@ env_check() { _green "Installing unzip" ${PACKAGE_INSTALL[int]} unzip fi + if ! command -v systemd-detect-virt >/dev/null 2>&1; then + _green "Installing systemd-detect-virt" + ${PACKAGE_INSTALL[int]} systemd-detect-virt + if [ $? -ne 0 ]; then + if ! command -v dmidecode >/dev/null 2>&1; then + _green "Installing dmidecode" + ${PACKAGE_INSTALL[int]} dmidecode + fi + fi + fi if ! command -v dd >/dev/null 2>&1; then _green "Installing dd" ${PACKAGE_INSTALL[int]} dd @@ -395,6 +405,7 @@ show_help() { geekbench (geekbench5) (仅支持 IPV4 环境,且内存大于 1GB 并需要持续联网,仅支持 amd64 和 arm64 架构。) speedtest (使用官方提供的二进制文件以获得更准确的测试结果。) ping (使用官方提供的二进制文件以获得更准确的测试结果。) + systemd-detect-virt 或 dmidecode (几乎所有类 Unix 系统都有,安装以获得更准确的测试结果。) 事实上,sysbench/geekbench 是上述依赖项中唯一必须安装的,没有它们无法测试 CPU 分数。 ./goecs.sh install 安装 goecs 命令 ./goecs.sh upgrade 升级 goecs 命令 @@ -413,6 +424,7 @@ Available commands: geekbench (geekbench5)(Only support IPV4 environment, and memory greater than 1GB network detection, only support amd64 and arm64 architecture.) speedtest (Use the officially provided binaries for more accurate test results.) ping (Use the officially provided binaries for more accurate test results.) + systemd-detect-virt OR dmidecode (Almost all unix-like systems have it, for more accurate test results.) In fact, sysbench/geekbench is the only one of the above dependencies that must be installed, without which the CPU score cannot be tested. ./goecs.sh install Install goecs command ./goecs.sh upgrade Upgrade goecs command