Compare commits

..

6 Commits

Author SHA1 Message Date
spiritysdx
1d6cd5984b update 2024-07-02 00:18:59 +08:00
spiritysdx
63b857c915 update 2024-07-01 19:46:16 +08:00
spiritysdx
6811f19db4 update 2024-07-01 19:38:06 +08:00
spiritysdx
847e1c0d6e update 2024-07-01 18:40:23 +08:00
spiritysdx
99a8448d53 update 2024-07-01 18:38:16 +08:00
spiritysdx
4fe9cd21ef update 2024-07-01 18:31:21 +08:00
5 changed files with 50 additions and 18 deletions

View File

@@ -35,6 +35,8 @@ Shell版本 https://github.com/spiritLHLS/ecs
curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
```
```
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
```
@@ -63,9 +65,31 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt
./goecs.sh delete
```
shell脚本的说明
```
Usage of goecs:
-backtrace windows
Available commands:
./goecs.sh env Check and Install package:
tar (Almost all unix-like systems have it.)
unzip (Almost all unix-like systems have it.)
dd (Almost all unix-like systems have it.)
fio (Almost all unix-like systems can be installed through the system's package manager.)
sysbench (Almost all unix-like systems can be installed through the system's package manager.)
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.)
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
./goecs.sh delete Uninstall goecs command
./goecs.sh help Show this message
```
goecs命令的说明
```
Usage: goecs [options]
-backtrace
Enable/Disable backtrace test (in 'en' language or on windows it always false) (default true)
-basic
Enable/Disable basic test (default true)
@@ -87,6 +111,7 @@ Usage of goecs:
Set disk test path, e.g., -diskp /root
-email
Enable/Disable email port test (default true)
-h Show help information
-l string
Set language (supported: en, zh) (default "zh")
-log
@@ -97,7 +122,7 @@ Usage of goecs:
Set memory test method (supported: sysbench, dd, winsat) (default "dd")
-menu
Enable/Disable menu mode, disable example: -menu=false (default true)
-nt3 windows
-nt3
Enable/Disable NT3 test (in 'en' language or on windows it always false) (default true)
-nt3loc string
Specify NT3 test location (supported: GZ, SH, BJ, CD for Guangzhou, Shanghai, Beijing, Chengdu) (default "GZ")

4
go.mod
View File

@@ -7,8 +7,8 @@ require (
github.com/oneclickvirt/CommonMediaTests v0.0.2-20240630023003
github.com/oneclickvirt/UnlockTests v0.0.10-20240630044930
github.com/oneclickvirt/backtrace v0.0.4-20240624090335
github.com/oneclickvirt/basics v0.0.3-20240701085439
github.com/oneclickvirt/cputest v0.0.7-20240701020012
github.com/oneclickvirt/basics v0.0.4-20240701161006
github.com/oneclickvirt/cputest v0.0.8-20240701113350
github.com/oneclickvirt/defaultset v0.0.2-20240624082446
github.com/oneclickvirt/disktest v0.0.3-20240629152513
github.com/oneclickvirt/gostun v0.0.2-20240625025941

8
go.sum
View File

@@ -81,10 +81,10 @@ github.com/oneclickvirt/UnlockTests v0.0.10-20240630044930 h1:/Sc4Eas1Pso18ak93w
github.com/oneclickvirt/UnlockTests v0.0.10-20240630044930/go.mod h1:HP3CvAS+AJWxxY+BVbxIOlvaQ87YOSge89vAMG52b5o=
github.com/oneclickvirt/backtrace v0.0.4-20240624090335 h1:0LP5KyA6GLlqQAtOF0uyBSAykHJrzOA96Eb87qUhGQw=
github.com/oneclickvirt/backtrace v0.0.4-20240624090335/go.mod h1:zvsC7xY/WZqs5KL2JB967OVnuqjNbxu9bW6wXRLo5h8=
github.com/oneclickvirt/basics v0.0.3-20240701085439 h1:1PE7Womqy4AW2c9PlyFdHsBocZXSo02V5uJDSzQLzgs=
github.com/oneclickvirt/basics v0.0.3-20240701085439/go.mod h1:dTB+/oyFQYfTYX55rFJVWatum5F9g62zjfmHCM6Vj1s=
github.com/oneclickvirt/cputest v0.0.7-20240701020012 h1:U5cCI+6ZU3pudoAlmb1b3yB9IQNm5AnDXi1TQAZJCIA=
github.com/oneclickvirt/cputest v0.0.7-20240701020012/go.mod h1:MmaHN9+XMntI3rLycwj8Ne31fG18IfNoa8N2utDK1CY=
github.com/oneclickvirt/basics v0.0.4-20240701161006 h1:3W74XEOzr6s9eGlXEmZuoocWd35T69d6OSEXl1HqVBA=
github.com/oneclickvirt/basics v0.0.4-20240701161006/go.mod h1:dTB+/oyFQYfTYX55rFJVWatum5F9g62zjfmHCM6Vj1s=
github.com/oneclickvirt/cputest v0.0.8-20240701113350 h1:OMIKQSvcqCmDuVCL2y8V1GI0/YSFmUs9Ikw6WalWsS0=
github.com/oneclickvirt/cputest v0.0.8-20240701113350/go.mod h1:MmaHN9+XMntI3rLycwj8Ne31fG18IfNoa8N2utDK1CY=
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.3-20240629152513 h1:ZW7MBMd2HxQi1ktg/ztVI2A10JzF4ZI6I7ATZvcK9w8=

View File

@@ -6,6 +6,7 @@ import (
"github.com/oneclickvirt/CommonMediaTests/commediatests"
backtraceori "github.com/oneclickvirt/backtrace/bk"
basicmodel "github.com/oneclickvirt/basics/model"
cputestmodel "github.com/oneclickvirt/cputest/model"
"github.com/oneclickvirt/ecs/backtrace"
"github.com/oneclickvirt/ecs/commediatest"
"github.com/oneclickvirt/ecs/cputest"
@@ -29,7 +30,7 @@ import (
)
var (
ecsVersion = "v0.0.26"
ecsVersion = "v0.0.28"
menuMode bool
input, choice string
showVersion bool
@@ -64,8 +65,8 @@ func main() {
goecsFlag.BoolVar(&utTestStatus, "ut", true, "Enable/Disable unlock media test")
goecsFlag.BoolVar(&securityTestStatus, "security", true, "Enable/Disable security test")
goecsFlag.BoolVar(&emailTestStatus, "email", true, "Enable/Disable email port test")
goecsFlag.BoolVar(&backtraceStatus, "backtrace", true, "Enable/Disable backtrace test (in 'en' language or on `windows` it always false)")
goecsFlag.BoolVar(&nt3Status, "nt3", true, "Enable/Disable NT3 test (in 'en' language or on `windows` it always false)")
goecsFlag.BoolVar(&backtraceStatus, "backtrace", true, "Enable/Disable backtrace test (in 'en' language or on windows it always false)")
goecsFlag.BoolVar(&nt3Status, "nt3", true, "Enable/Disable NT3 test (in 'en' language or on windows it always false)")
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)")
@@ -80,7 +81,7 @@ func main() {
goecsFlag.Parse(os.Args[1:])
if help {
fmt.Printf("Usage: %s [options]\n", os.Args[0])
flag.PrintDefaults()
goecsFlag.PrintDefaults()
return
}
sig := make(chan os.Signal, 1)
@@ -91,6 +92,7 @@ func main() {
}
if enableLogger {
basicmodel.EnableLoger = true
cputestmodel.EnableLoger = true
speedtestmodel.EnableLoger = true
gostunmodel.EnableLoger = true
commediatests.EnableLoger = true
@@ -246,7 +248,7 @@ func main() {
utils.PrintHead(language, width, ecsVersion)
if basicStatus || securityTestStatus {
if basicStatus {
utils.PrintCenteredTitle("基础信息", width)
utils.PrintCenteredTitle("系统基础信息", width)
}
basicInfo, securityInfo, nt3CheckType = utils.SecurityCheck(language, nt3CheckType, securityTestStatus)
if basicStatus {
@@ -315,14 +317,14 @@ func main() {
if runtime.GOOS != "windows" {
output = utils.PrintAndCapture(func() {
if backtraceStatus {
utils.PrintCenteredTitle("三网回程", width)
utils.PrintCenteredTitle("三网回程线路检测", width)
backtrace.BackTrace()
}
}, tempOutput, output)
// nexttrace 在win上不支持检测报错 bind: An invalid argument was supplied.
output = utils.PrintAndCapture(func() {
if nt3Status {
utils.PrintCenteredTitle("路由检测", width)
utils.PrintCenteredTitle("三网回程路由检测", width)
ntrace.TraceRoute3(language, nt3Location, nt3CheckType)
}
}, tempOutput, output)
@@ -358,7 +360,7 @@ func main() {
utils.PrintHead(language, width, ecsVersion)
if basicStatus || securityTestStatus {
if basicStatus {
utils.PrintCenteredTitle("Basic Information", width)
utils.PrintCenteredTitle("System Basic Information", width)
}
basicInfo, securityInfo, nt3CheckType = utils.SecurityCheck(language, nt3CheckType, securityTestStatus)
if basicStatus {
@@ -393,7 +395,7 @@ func main() {
}
output = utils.PrintAndCapture(func() {
if commTestStatus {
utils.PrintCenteredTitle("The Three Families Streaming Media Unlock", width)
utils.PrintCenteredTitle("The Three Main Streaming Media Unlock", width)
commediatest.ComMediaTest(language)
}
}, tempOutput, output)

View File

@@ -300,6 +300,11 @@ env_check() {
echo "rm -rf /usr/bin/speedtest-go"
_blue "to uninstall speedtest and speedtest-go"
fi
if [ "$(uname -s)" = "Darwin" ]; then
echo "Detected MacOS. Installing sysbench and fio..."
# 使用Homebrew安装sysbench和fio免交互
brew install --force sysbench fio
fi
_green "The environment is ready."
}