This commit is contained in:
spiritysdx
2024-07-01 18:13:57 +08:00
parent fadbf9c6aa
commit 01b9ee4505
2 changed files with 59 additions and 1 deletions

View File

@@ -61,4 +61,55 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt
``` ```
./goecs.sh delete ./goecs.sh delete
```
```
Usage of goecs:
-backtrace windows
Enable/Disable backtrace test (in 'en' language or on windows it always false) (default true)
-basic
Enable/Disable basic test (default true)
-comm
Enable/Disable common media test (default true)
-cpu
Enable/Disable CPU test (default true)
-cpum string
Set CPU test method (supported: sysbench, geekbench, winsat) (default "sysbench")
-cput string
Set CPU test thread mode (supported: single, multi) (default "multi")
-disk
Enable/Disable disk test (default true)
-diskm string
Set disk test method (supported: fio, dd, winsat) (default "fio")
-diskmc
Enable/Disable multiple disk checks, e.g., -diskmc=false
-diskp string
Set disk test path, e.g., -diskp /root
-email
Enable/Disable email port test (default true)
-l string
Set language (supported: en, zh) (default "zh")
-log
Enable/Disable logging in the current path
-memory
Enable/Disable memory test (default true)
-memorym string
Set memory test method (supported: sysbench, dd, winsat) (default "dd")
-menu
Enable/Disable menu mode, disable example: -menu=false (default true)
-nt3 windows
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")
-nt3t string
Set NT3 test type (supported: both, ipv4, ipv6) (default "ipv4")
-security
Enable/Disable security test (default true)
-speed
Enable/Disable speed test (default true)
-spnum int
Set the number of servers per operator for speed test (default 2)
-ut
Enable/Disable unlock media test (default true)
-v Display version information
``` ```

View File

@@ -29,7 +29,7 @@ import (
) )
var ( var (
ecsVersion = "v0.0.24" ecsVersion = "v0.0.26"
menuMode bool menuMode bool
input, choice string input, choice string
showVersion bool showVersion bool
@@ -47,10 +47,12 @@ var (
backtraceStatus, nt3Status, speedTestStatus bool backtraceStatus, nt3Status, speedTestStatus bool
filePath = "goecs.txt" filePath = "goecs.txt"
enabelUpload = true enabelUpload = true
help bool
goecsFlag = flag.NewFlagSet("goecs", flag.ContinueOnError) goecsFlag = flag.NewFlagSet("goecs", flag.ContinueOnError)
) )
func main() { func main() {
goecsFlag.BoolVar(&help, "h", false, "Show help information")
goecsFlag.BoolVar(&showVersion, "v", false, "Display version information") goecsFlag.BoolVar(&showVersion, "v", false, "Display version information")
goecsFlag.BoolVar(&menuMode, "menu", true, "Enable/Disable menu mode, disable example: -menu=false") // true 默认启用菜单栏模式 goecsFlag.BoolVar(&menuMode, "menu", true, "Enable/Disable menu mode, disable example: -menu=false") // true 默认启用菜单栏模式
goecsFlag.StringVar(&language, "l", "zh", "Set language (supported: en, zh)") goecsFlag.StringVar(&language, "l", "zh", "Set language (supported: en, zh)")
@@ -76,6 +78,11 @@ func main() {
goecsFlag.IntVar(&spNum, "spnum", 2, "Set the number of servers per operator for speed test") goecsFlag.IntVar(&spNum, "spnum", 2, "Set the number of servers per operator for speed test")
goecsFlag.BoolVar(&enableLogger, "log", false, "Enable/Disable logging in the current path") goecsFlag.BoolVar(&enableLogger, "log", false, "Enable/Disable logging in the current path")
goecsFlag.Parse(os.Args[1:]) goecsFlag.Parse(os.Args[1:])
if help {
fmt.Printf("Usage: %s [options]\n", os.Args[0])
flag.PrintDefaults()
return
}
sig := make(chan os.Signal, 1) sig := make(chan os.Signal, 1)
signal.Notify(sig, os.Interrupt, syscall.SIGINT, syscall.SIGTERM) signal.Notify(sig, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
if showVersion { if showVersion {