mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-09-28 12:12:14 +08:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bdb53ac436 | ||
![]() |
01b9ee4505 | ||
![]() |
fadbf9c6aa | ||
![]() |
60e235e4d7 | ||
![]() |
da4b431761 | ||
![]() |
7fff30521e | ||
![]() |
e7c78774ca |
81
README.md
81
README.md
@@ -29,6 +29,87 @@ 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://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
|
||||||
|
```
|
||||||
|
|
||||||
|
安装环境
|
||||||
|
|
||||||
|
```
|
||||||
|
./goecs.sh env
|
||||||
|
```
|
||||||
|
|
||||||
|
安装goecs
|
||||||
|
|
||||||
|
```
|
||||||
|
./goecs.sh install
|
||||||
|
```
|
||||||
|
|
||||||
|
升级goecs
|
||||||
|
|
||||||
|
```
|
||||||
|
./goecs.sh upgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
卸载goecs
|
||||||
|
|
||||||
|
```
|
||||||
|
./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
|
||||||
```
|
```
|
191
goecs.go
191
goecs.go
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ecsFlag "flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/oneclickvirt/CommonMediaTests/commediatests"
|
"github.com/oneclickvirt/CommonMediaTests/commediatests"
|
||||||
backtraceori "github.com/oneclickvirt/backtrace/bk"
|
backtraceori "github.com/oneclickvirt/backtrace/bk"
|
||||||
@@ -29,7 +29,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ecsVersion = "v0.0.21"
|
ecsVersion = "v0.0.26"
|
||||||
menuMode bool
|
menuMode bool
|
||||||
input, choice string
|
input, choice string
|
||||||
showVersion bool
|
showVersion bool
|
||||||
@@ -47,34 +47,42 @@ 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)
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ecsFlag.BoolVar(&showVersion, "v", false, "Display version information")
|
goecsFlag.BoolVar(&help, "h", false, "Show help information")
|
||||||
ecsFlag.BoolVar(&menuMode, "menu", true, "Enable/Disable menu mode, disable example: -menu=false") // true 默认启用菜单栏模式
|
goecsFlag.BoolVar(&showVersion, "v", false, "Display version information")
|
||||||
ecsFlag.StringVar(&language, "l", "zh", "Set language (supported: en, zh)")
|
goecsFlag.BoolVar(&menuMode, "menu", true, "Enable/Disable menu mode, disable example: -menu=false") // true 默认启用菜单栏模式
|
||||||
ecsFlag.BoolVar(&basicStatus, "basic", true, "Enable/Disable basic test")
|
goecsFlag.StringVar(&language, "l", "zh", "Set language (supported: en, zh)")
|
||||||
ecsFlag.BoolVar(&cpuTestStatus, "cpu", true, "Enable/Disable CPU test")
|
goecsFlag.BoolVar(&basicStatus, "basic", true, "Enable/Disable basic test")
|
||||||
ecsFlag.BoolVar(&memoryTestStatus, "memory", true, "Enable/Disable memory test")
|
goecsFlag.BoolVar(&cpuTestStatus, "cpu", true, "Enable/Disable CPU test")
|
||||||
ecsFlag.BoolVar(&diskTestStatus, "disk", true, "Enable/Disable disk test")
|
goecsFlag.BoolVar(&memoryTestStatus, "memory", true, "Enable/Disable memory test")
|
||||||
ecsFlag.BoolVar(&commTestStatus, "comm", true, "Enable/Disable common media test")
|
goecsFlag.BoolVar(&diskTestStatus, "disk", true, "Enable/Disable disk test")
|
||||||
ecsFlag.BoolVar(&utTestStatus, "ut", true, "Enable/Disable unlock media test")
|
goecsFlag.BoolVar(&commTestStatus, "comm", true, "Enable/Disable common media test")
|
||||||
ecsFlag.BoolVar(&securityTestStatus, "security", true, "Enable/Disable security test")
|
goecsFlag.BoolVar(&utTestStatus, "ut", true, "Enable/Disable unlock media test")
|
||||||
ecsFlag.BoolVar(&emailTestStatus, "email", true, "Enable/Disable email port test")
|
goecsFlag.BoolVar(&securityTestStatus, "security", true, "Enable/Disable security test")
|
||||||
ecsFlag.BoolVar(&backtraceStatus, "backtrace", true, "Enable/Disable backtrace test (in 'en' language or on `windows` it always false)")
|
goecsFlag.BoolVar(&emailTestStatus, "email", true, "Enable/Disable email port test")
|
||||||
ecsFlag.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)")
|
||||||
ecsFlag.BoolVar(&speedTestStatus, "speed", true, "Enable/Disable speed test")
|
goecsFlag.BoolVar(&nt3Status, "nt3", true, "Enable/Disable NT3 test (in 'en' language or on `windows` it always false)")
|
||||||
ecsFlag.StringVar(&cpuTestMethod, "cpum", "sysbench", "Set CPU test method (supported: sysbench, geekbench, winsat)")
|
goecsFlag.BoolVar(&speedTestStatus, "speed", true, "Enable/Disable speed test")
|
||||||
ecsFlag.StringVar(&cpuTestThreadMode, "cput", "multi", "Set CPU test thread mode (supported: single, multi)")
|
goecsFlag.StringVar(&cpuTestMethod, "cpum", "sysbench", "Set CPU test method (supported: sysbench, geekbench, winsat)")
|
||||||
ecsFlag.StringVar(&memoryTestMethod, "memorym", "dd", "Set memory test method (supported: sysbench, dd, winsat)")
|
goecsFlag.StringVar(&cpuTestThreadMode, "cput", "multi", "Set CPU test thread mode (supported: single, multi)")
|
||||||
ecsFlag.StringVar(&diskTestMethod, "diskm", "fio", "Set disk test method (supported: fio, dd, winsat)")
|
goecsFlag.StringVar(&memoryTestMethod, "memorym", "dd", "Set memory test method (supported: sysbench, dd, winsat)")
|
||||||
ecsFlag.StringVar(&diskTestPath, "diskp", "", "Set disk test path, e.g., -diskp /root")
|
goecsFlag.StringVar(&diskTestMethod, "diskm", "fio", "Set disk test method (supported: fio, dd, winsat)")
|
||||||
ecsFlag.BoolVar(&diskMultiCheck, "diskmc", false, "Enable/Disable multiple disk checks, e.g., -diskmc=false")
|
goecsFlag.StringVar(&diskTestPath, "diskp", "", "Set disk test path, e.g., -diskp /root")
|
||||||
ecsFlag.StringVar(&nt3Location, "nt3loc", "GZ", "Specify NT3 test location (supported: GZ, SH, BJ, CD for Guangzhou, Shanghai, Beijing, Chengdu)")
|
goecsFlag.BoolVar(&diskMultiCheck, "diskmc", false, "Enable/Disable multiple disk checks, e.g., -diskmc=false")
|
||||||
ecsFlag.StringVar(&nt3CheckType, "nt3t", "ipv4", "Set NT3 test type (supported: both, ipv4, ipv6)")
|
goecsFlag.StringVar(&nt3Location, "nt3loc", "GZ", "Specify NT3 test location (supported: GZ, SH, BJ, CD for Guangzhou, Shanghai, Beijing, Chengdu)")
|
||||||
ecsFlag.IntVar(&spNum, "spnum", 2, "Set the number of servers per operator for speed test")
|
goecsFlag.StringVar(&nt3CheckType, "nt3t", "ipv4", "Set NT3 test type (supported: both, ipv4, ipv6)")
|
||||||
ecsFlag.BoolVar(&enableLogger, "log", false, "Enable/Disable logging in the current path")
|
goecsFlag.IntVar(&spNum, "spnum", 2, "Set the number of servers per operator for speed test")
|
||||||
ecsFlag.Parse()
|
goecsFlag.BoolVar(&enableLogger, "log", false, "Enable/Disable logging in the current path")
|
||||||
|
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 {
|
||||||
@@ -94,6 +102,7 @@ func main() {
|
|||||||
backtraceStatus, nt3Status, speedTestStatus = false, false, false
|
backtraceStatus, nt3Status, speedTestStatus = false, false, false
|
||||||
switch language {
|
switch language {
|
||||||
case "zh":
|
case "zh":
|
||||||
|
fmt.Println("VPS融合怪版本: ", ecsVersion)
|
||||||
fmt.Println("1. 融合怪完全体")
|
fmt.Println("1. 融合怪完全体")
|
||||||
fmt.Println("2. 极简版(系统信息+CPU+内存+磁盘+测速节点5个)")
|
fmt.Println("2. 极简版(系统信息+CPU+内存+磁盘+测速节点5个)")
|
||||||
fmt.Println("3. 精简版(系统信息+CPU+内存+磁盘+御三家+常用流媒体+回程+路由+测速节点5个)")
|
fmt.Println("3. 精简版(系统信息+CPU+内存+磁盘+御三家+常用流媒体+回程+路由+测速节点5个)")
|
||||||
@@ -105,6 +114,7 @@ func main() {
|
|||||||
fmt.Println("9. IP质量检测(15个数据库的IP检测+邮件端口检测)")
|
fmt.Println("9. IP质量检测(15个数据库的IP检测+邮件端口检测)")
|
||||||
fmt.Println("10. 三网回程线路+广州三网路由+全国三网延迟")
|
fmt.Println("10. 三网回程线路+广州三网路由+全国三网延迟")
|
||||||
case "en":
|
case "en":
|
||||||
|
fmt.Println("VPS Fusion Monster Test Version: ", ecsVersion)
|
||||||
fmt.Println("1. VPS Fusion Monster Test Comprehensive Test Suite")
|
fmt.Println("1. VPS Fusion Monster Test Comprehensive Test Suite")
|
||||||
fmt.Println("2. Minimal Test Suite (System Info + CPU + Memory + Disk + 5 Speed Test Nodes)")
|
fmt.Println("2. Minimal Test Suite (System Info + CPU + Memory + Disk + 5 Speed Test Nodes)")
|
||||||
fmt.Println("3. Standard Test Suite (System Info + CPU + Memory + Disk + Basic Unlock Tests + Common Streaming Services + 5 Speed Test Nodes)")
|
fmt.Println("3. Standard Test Suite (System Info + CPU + Memory + Disk + Basic Unlock Tests + Common Streaming Services + 5 Speed Test Nodes)")
|
||||||
@@ -230,9 +240,9 @@ func main() {
|
|||||||
utils.ProcessAndUpload(output, filePath, enabelUpload)
|
utils.ProcessAndUpload(output, filePath, enabelUpload)
|
||||||
os.Exit(1) // 使用非零状态码退出,表示意外退出
|
os.Exit(1) // 使用非零状态码退出,表示意外退出
|
||||||
}()
|
}()
|
||||||
output = utils.PrintAndCapture(func() {
|
switch language {
|
||||||
switch language {
|
case "zh":
|
||||||
case "zh":
|
output = utils.PrintAndCapture(func() {
|
||||||
utils.PrintHead(language, width, ecsVersion)
|
utils.PrintHead(language, width, ecsVersion)
|
||||||
if basicStatus || securityTestStatus {
|
if basicStatus || securityTestStatus {
|
||||||
if basicStatus {
|
if basicStatus {
|
||||||
@@ -243,61 +253,81 @@ func main() {
|
|||||||
fmt.Printf(basicInfo)
|
fmt.Printf(basicInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if cpuTestStatus {
|
if cpuTestStatus {
|
||||||
utils.PrintCenteredTitle(fmt.Sprintf("CPU测试-通过%s测试", cpuTestMethod), width)
|
utils.PrintCenteredTitle(fmt.Sprintf("CPU测试-通过%s测试", cpuTestMethod), width)
|
||||||
cputest.CpuTest(language, cpuTestMethod, cpuTestThreadMode)
|
cputest.CpuTest(language, cpuTestMethod, cpuTestThreadMode)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if memoryTestStatus {
|
if memoryTestStatus {
|
||||||
utils.PrintCenteredTitle(fmt.Sprintf("内存测试-通过%s测试", cpuTestMethod), width)
|
utils.PrintCenteredTitle(fmt.Sprintf("内存测试-通过%s测试", cpuTestMethod), width)
|
||||||
memorytest.MemoryTest(language, memoryTestMethod)
|
memorytest.MemoryTest(language, memoryTestMethod)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if diskTestStatus {
|
if diskTestStatus {
|
||||||
utils.PrintCenteredTitle(fmt.Sprintf("硬盘测试-通过%s测试", diskTestMethod), width)
|
utils.PrintCenteredTitle(fmt.Sprintf("硬盘测试-通过%s测试", diskTestMethod), width)
|
||||||
disktest.DiskTest(language, diskTestMethod, diskTestPath, diskMultiCheck)
|
disktest.DiskTest(language, diskTestMethod, diskTestPath, diskMultiCheck)
|
||||||
}
|
}
|
||||||
if emailTestStatus {
|
}, tempOutput, output)
|
||||||
wg2.Add(1)
|
if emailTestStatus {
|
||||||
go func() {
|
wg2.Add(1)
|
||||||
defer wg2.Done()
|
go func() {
|
||||||
emailInfo = email.EmailCheck()
|
defer wg2.Done()
|
||||||
}()
|
emailInfo = email.EmailCheck()
|
||||||
}
|
}()
|
||||||
if utTestStatus {
|
}
|
||||||
wg1.Add(1)
|
if utTestStatus {
|
||||||
go func() {
|
wg1.Add(1)
|
||||||
defer wg1.Done()
|
go func() {
|
||||||
mediaInfo = unlocktest.MediaTest(language)
|
defer wg1.Done()
|
||||||
}()
|
mediaInfo = unlocktest.MediaTest(language)
|
||||||
}
|
}()
|
||||||
|
}
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if commTestStatus {
|
if commTestStatus {
|
||||||
utils.PrintCenteredTitle("御三家流媒体解锁", width)
|
utils.PrintCenteredTitle("御三家流媒体解锁", width)
|
||||||
commediatest.ComMediaTest(language)
|
commediatest.ComMediaTest(language)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if utTestStatus {
|
if utTestStatus {
|
||||||
utils.PrintCenteredTitle("跨国流媒体解锁", width)
|
utils.PrintCenteredTitle("跨国流媒体解锁", width)
|
||||||
wg1.Wait()
|
wg1.Wait()
|
||||||
fmt.Printf(mediaInfo)
|
fmt.Printf(mediaInfo)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if securityTestStatus {
|
if securityTestStatus {
|
||||||
utils.PrintCenteredTitle("IP质量检测", width)
|
utils.PrintCenteredTitle("IP质量检测", width)
|
||||||
fmt.Printf(securityInfo)
|
fmt.Printf(securityInfo)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if emailTestStatus {
|
if emailTestStatus {
|
||||||
utils.PrintCenteredTitle("邮件端口检测", width)
|
utils.PrintCenteredTitle("邮件端口检测", width)
|
||||||
wg2.Wait()
|
wg2.Wait()
|
||||||
fmt.Println(emailInfo)
|
fmt.Println(emailInfo)
|
||||||
}
|
}
|
||||||
if runtime.GOOS != "windows" {
|
}, tempOutput, output)
|
||||||
|
if runtime.GOOS != "windows" {
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if backtraceStatus {
|
if backtraceStatus {
|
||||||
utils.PrintCenteredTitle("三网回程", width)
|
utils.PrintCenteredTitle("三网回程", width)
|
||||||
backtrace.BackTrace()
|
backtrace.BackTrace()
|
||||||
}
|
}
|
||||||
// nexttrace 在win上不支持检测,报错 bind: An invalid argument was supplied.
|
}, tempOutput, output)
|
||||||
|
// nexttrace 在win上不支持检测,报错 bind: An invalid argument was supplied.
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if nt3Status {
|
if nt3Status {
|
||||||
utils.PrintCenteredTitle("路由检测", width)
|
utils.PrintCenteredTitle("路由检测", width)
|
||||||
ntrace.TraceRoute3(language, nt3Location, nt3CheckType)
|
ntrace.TraceRoute3(language, nt3Location, nt3CheckType)
|
||||||
}
|
}
|
||||||
}
|
}, tempOutput, output)
|
||||||
|
}
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if speedTestStatus {
|
if speedTestStatus {
|
||||||
utils.PrintCenteredTitle("就近节点测速", width)
|
utils.PrintCenteredTitle("就近节点测速", width)
|
||||||
speedtest.ShowHead(language)
|
speedtest.ShowHead(language)
|
||||||
@@ -311,16 +341,20 @@ func main() {
|
|||||||
speedtest.CustomSP("net", "global", 4)
|
speedtest.CustomSP("net", "global", 4)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
endTime := time.Now()
|
||||||
|
duration := endTime.Sub(startTime)
|
||||||
|
minutes := int(duration.Minutes())
|
||||||
|
seconds := int(duration.Seconds()) % 60
|
||||||
|
currentTime := time.Now().Format("Mon Jan 2 15:04:05 MST 2006")
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
utils.PrintCenteredTitle("", width)
|
utils.PrintCenteredTitle("", width)
|
||||||
endTime := time.Now()
|
|
||||||
duration := endTime.Sub(startTime)
|
|
||||||
minutes := int(duration.Minutes())
|
|
||||||
seconds := int(duration.Seconds()) % 60
|
|
||||||
currentTime := time.Now().Format("Mon Jan 2 15:04:05 MST 2006")
|
|
||||||
fmt.Printf("花费 : %d 分 %d 秒\n", minutes, seconds)
|
fmt.Printf("花费 : %d 分 %d 秒\n", minutes, seconds)
|
||||||
fmt.Printf("时间 : %s\n", currentTime)
|
fmt.Printf("时间 : %s\n", currentTime)
|
||||||
utils.PrintCenteredTitle("", width)
|
utils.PrintCenteredTitle("", width)
|
||||||
case "en":
|
}, tempOutput, output)
|
||||||
|
case "en":
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
utils.PrintHead(language, width, ecsVersion)
|
utils.PrintHead(language, width, ecsVersion)
|
||||||
if basicStatus || securityTestStatus {
|
if basicStatus || securityTestStatus {
|
||||||
if basicStatus {
|
if basicStatus {
|
||||||
@@ -331,60 +365,79 @@ func main() {
|
|||||||
fmt.Printf(basicInfo)
|
fmt.Printf(basicInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if cpuTestStatus {
|
if cpuTestStatus {
|
||||||
utils.PrintCenteredTitle(fmt.Sprintf("CPU Test - %s Method", cpuTestMethod), width)
|
utils.PrintCenteredTitle(fmt.Sprintf("CPU Test - %s Method", cpuTestMethod), width)
|
||||||
cputest.CpuTest(language, cpuTestMethod, cpuTestThreadMode)
|
cputest.CpuTest(language, cpuTestMethod, cpuTestThreadMode)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if memoryTestStatus {
|
if memoryTestStatus {
|
||||||
utils.PrintCenteredTitle(fmt.Sprintf("Memory Test - %s Method", memoryTestMethod), width)
|
utils.PrintCenteredTitle(fmt.Sprintf("Memory Test - %s Method", memoryTestMethod), width)
|
||||||
memorytest.MemoryTest(language, memoryTestMethod)
|
memorytest.MemoryTest(language, memoryTestMethod)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if diskTestStatus {
|
if diskTestStatus {
|
||||||
utils.PrintCenteredTitle(fmt.Sprintf("Disk Test - %s Method", diskTestMethod), width)
|
utils.PrintCenteredTitle(fmt.Sprintf("Disk Test - %s Method", diskTestMethod), width)
|
||||||
disktest.DiskTest(language, diskTestMethod, diskTestPath, diskMultiCheck)
|
disktest.DiskTest(language, diskTestMethod, diskTestPath, diskMultiCheck)
|
||||||
}
|
}
|
||||||
if emailTestStatus {
|
}, tempOutput, output)
|
||||||
wg1.Add(1)
|
if emailTestStatus {
|
||||||
go func() {
|
wg1.Add(1)
|
||||||
defer wg1.Done()
|
go func() {
|
||||||
emailInfo = email.EmailCheck()
|
defer wg1.Done()
|
||||||
}()
|
emailInfo = email.EmailCheck()
|
||||||
}
|
}()
|
||||||
|
}
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if commTestStatus {
|
if commTestStatus {
|
||||||
utils.PrintCenteredTitle("The Three Families Streaming Media Unlock", width)
|
utils.PrintCenteredTitle("The Three Families Streaming Media Unlock", width)
|
||||||
commediatest.ComMediaTest(language)
|
commediatest.ComMediaTest(language)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if utTestStatus {
|
if utTestStatus {
|
||||||
utils.PrintCenteredTitle("Cross-Border Streaming Media Unlock", width)
|
utils.PrintCenteredTitle("Cross-Border Streaming Media Unlock", width)
|
||||||
unlocktest.MediaTest(language)
|
unlocktest.MediaTest(language)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if securityTestStatus {
|
if securityTestStatus {
|
||||||
utils.PrintCenteredTitle("IP Quality Check", width)
|
utils.PrintCenteredTitle("IP Quality Check", width)
|
||||||
fmt.Printf(securityInfo)
|
fmt.Printf(securityInfo)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if emailTestStatus {
|
if emailTestStatus {
|
||||||
utils.PrintCenteredTitle("Email Port Check", width)
|
utils.PrintCenteredTitle("Email Port Check", width)
|
||||||
wg1.Wait()
|
wg1.Wait()
|
||||||
fmt.Println(emailInfo)
|
fmt.Println(emailInfo)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
if speedTestStatus {
|
if speedTestStatus {
|
||||||
utils.PrintCenteredTitle("Nearby Node Speed Test", width)
|
utils.PrintCenteredTitle("Nearby Node Speed Test", width)
|
||||||
speedtest.ShowHead(language)
|
speedtest.ShowHead(language)
|
||||||
speedtest.NearbySP()
|
speedtest.NearbySP()
|
||||||
speedtest.CustomSP("net", "global", -1)
|
speedtest.CustomSP("net", "global", -1)
|
||||||
}
|
}
|
||||||
|
}, tempOutput, output)
|
||||||
|
|
||||||
|
endTime := time.Now()
|
||||||
|
duration := endTime.Sub(startTime)
|
||||||
|
minutes := int(duration.Minutes())
|
||||||
|
seconds := int(duration.Seconds()) % 60
|
||||||
|
currentTime := time.Now().Format("Mon Jan 2 15:04:05 MST 2006")
|
||||||
|
output = utils.PrintAndCapture(func() {
|
||||||
utils.PrintCenteredTitle("", width)
|
utils.PrintCenteredTitle("", width)
|
||||||
endTime := time.Now()
|
|
||||||
duration := endTime.Sub(startTime)
|
|
||||||
minutes := int(duration.Minutes())
|
|
||||||
seconds := int(duration.Seconds()) % 60
|
|
||||||
currentTime := time.Now().Format("Mon Jan 2 15:04:05 MST 2006")
|
|
||||||
fmt.Printf("Cost Time : %d 分 %d 秒\n", minutes, seconds)
|
fmt.Printf("Cost Time : %d 分 %d 秒\n", minutes, seconds)
|
||||||
fmt.Printf("Current Time : %s\n", currentTime)
|
fmt.Printf("Current Time : %s\n", currentTime)
|
||||||
utils.PrintCenteredTitle("", width)
|
utils.PrintCenteredTitle("", width)
|
||||||
default:
|
}, tempOutput, output)
|
||||||
fmt.Println("Unsupported language")
|
default:
|
||||||
}
|
fmt.Println("Unsupported language")
|
||||||
}, tempOutput, output)
|
}
|
||||||
utils.ProcessAndUpload(output, filePath, enabelUpload)
|
utils.ProcessAndUpload(output, filePath, enabelUpload)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user