Compare commits

..

9 Commits

Author SHA1 Message Date
spiritysdx
ffb9bfdf7f update 2024-07-04 22:08:51 +08:00
spiritysdx
17e96a94fe update 2024-07-04 21:27:55 +08:00
spiritysdx
b16b22c117 update 2024-07-04 21:19:33 +08:00
spiritysdx
9a6879207f update 2024-07-04 20:45:10 +08:00
spiritysdx
8e66e5c801 update 2024-07-04 20:31:58 +08:00
spiritysdx
47d84ac3dd update 2024-07-04 20:30:45 +08:00
spiritysdx
073a894e26 update 2024-07-04 20:24:37 +08:00
spiritysdx
7a92e6688e update 2024-07-04 20:23:14 +08:00
spiritysdx
971a2c66c7 update 2024-07-04 20:05:05 +08:00
5 changed files with 55 additions and 25 deletions

View File

@@ -12,6 +12,8 @@ jobs:
# 1.20 是 Windows 7/8 Server 2008/2012 最后一个支持版本
image: goreleaser/goreleaser-cross:v1.20
steps:
- run: |
git config --global --add safe.directory /__w/ecs/ecs
- name: Checkout
uses: actions/checkout@v3
with:

View File

@@ -12,7 +12,7 @@ Shell版本 https://github.com/spiritLHLS/ecs
## 适配系统和架构
编译支持的架构: amd64、arm、arm64、386、s390x、ppc64、ppc64le、riscv64
编译支持的架构: amd64、arm、arm64、386、s390x、mips、mipsle、s390x、riscv64
测试支持的架构: amd64、arm64
@@ -24,7 +24,7 @@ Shell版本 https://github.com/spiritLHLS/ecs
更多系统请自行测试
待支持的系统(存在硬件测试BUG未修复): MacOS
待支持的系统(存在硬件测试BUG未修复): MacOS、FreeBSD、OpenBSD
## 功能
@@ -42,7 +42,7 @@ Shell版本 https://github.com/spiritLHLS/ecs
- [x] 测试网速[基于[speedtest.net-爬虫](https://github.com/spiritLHLS/speedtest.net-CN-ID)、[speedtest.cn-爬虫](https://github.com/spiritLHLS/speedtest.cn-CN-ID)的数据,借鉴[speedtest-go](https://github.com/showwin/speedtest-go)二次开发至于[oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest)]
- [x] 测试三网Ping值[借鉴[ecsspeed](https://github.com/spiritLHLS/ecsspeed)的逻辑二次开发至于[pingtest](https://github.com/oneclickvirt/pingtest)]
## Linux上使用的说明
## Linux/FreeBSD/MacOS上使用的说明
### 一键命令
@@ -177,6 +177,8 @@ Usage: goecs [options]
Enable/Disable speed test (default true)
-spnum int
Set the number of servers per operator for speed test (default 2)
-upload
Enable/Disable upload the result (default true)
-ut
Enable/Disable unlock media test (default true)
-v Display version information
@@ -188,7 +190,7 @@ Usage: goecs [options]
https://github.com/oneclickvirt/ecs/releases
找其中最新的版本,按照对应架构下载对应的 .tar.gz 文件解压后文件夹内有一个exe文件
找其中最新的版本,按照对应架构下载对应的 .zip 文件解压后文件夹内有一个exe文件
选择该exe文件右键点击选择管理员模式运行(非管理员模式运行无法进行硬件测试),唤起菜单自选

View File

@@ -12,19 +12,19 @@ Shell version: https://github.com/spiritLHLS/ecs/blob/main/README_EN.md
## Supported Systems and Architectures
Architectures supported for compilation: amd64, arm, arm64, 386, s390x、ppc64、ppc64le、riscv64
Architectures supported for compilation: amd64armarm64386s390x、mips、mipsle、s390x、riscv64
Tested architectures: amd64, arm64
More architectures please test by yourself
Compilation support: Linux, Windows, FreeBSD, OpenBSD
Compilation support: Linux, WindowsFreeBSDOpenBSD
Tested on: Linux, Windows
More systems to be tested
Systems to be supported (hardware testing bugs not yet fixed): MacOS
Systems to be supported (hardware testing bugs not yet fixed): MacOS、FreeBSD、OpenBSD
## Features
@@ -42,7 +42,7 @@ Systems to be supported (hardware testing bugs not yet fixed): MacOS
- [x] Speed test [Based on data from [speedtest.net-crawler](https://github.com/spiritLHLS/speedtest.net-CN-ID), [speedtest.cn-crawler](https://github.com/spiritLHLS/speedtest.cn-CN-ID), modified from [speedtest-go](https://github.com/showwin/speedtest-go) to [oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest)]
- [x] Three-network Ping test [Modified from [ecsspeed](https://github.com/spiritLHLS/ecsspeed) logic to [pingtest](https://github.com/oneclickvirt/pingtest)]
## Instructions for Use on Linux
## Instructions for Use on Linux/FreeBSD/MacOS
### one-click command
@@ -165,6 +165,8 @@ Usage: goecs [options]
Enable/Disable speed test (default true)
-spnum int
Set the number of servers per operator for speed test (default 2)
-upload
Enable/Disable upload the result (default true)
-ut
Enable/Disable unlock media test (default true)
-v Display version information
@@ -176,7 +178,7 @@ Download the compressed file with the exe file
https://github.com/oneclickvirt/ecs/releases
Find the latest version, download the .tar.gz file corresponding to your architecture, and unzip it to get an exe file.
Find the latest version, download the .zip file corresponding to your architecture, and unzip it to get an exe file.
Right-click the exe file and select Run as administrator (running without administrator mode will not allow hardware testing), and invoke the menu to choose.

View File

@@ -37,7 +37,7 @@ import (
)
var (
ecsVersion = "v0.0.47"
ecsVersion = "v0.0.49"
menuMode bool
onlyChinaTest bool
input, choice string
@@ -252,10 +252,10 @@ func main() {
securityTestStatus = false
}
var (
startTime time.Time
wg1, wg2 sync.WaitGroup
basicInfo, securityInfo, emailInfo, mediaInfo string
output, tempOutput string
startTime time.Time
wg1, wg2, wg3 sync.WaitGroup
basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo string
output, tempOutput string
)
// 启动一个goroutine来等待信号内置计时器
go func() {
@@ -308,6 +308,13 @@ func main() {
disktest.DiskTest(language, diskTestMethod, diskTestPath, diskMultiCheck)
}
}, tempOutput, output)
if onlyChinaTest || pingTestStatus {
wg3.Add(1)
go func() {
defer wg3.Done()
ptInfo = pt.PingTest()
}()
}
if emailTestStatus {
wg2.Add(1)
go func() {
@@ -365,7 +372,8 @@ func main() {
output = utils.PrintAndCapture(func() {
if onlyChinaTest || pingTestStatus {
utils.PrintCenteredTitle("三网ICMP的PING值检测", width)
pt.PingTest()
wg3.Wait()
fmt.Println(ptInfo)
}
}, tempOutput, output)
}

View File

@@ -80,16 +80,16 @@ goecs_check() {
cdn_urls=("https://cdn0.spiritlhl.top/" "http://cdn3.spiritlhl.net/" "http://cdn1.spiritlhl.net/" "http://cdn2.spiritlhl.net/")
check_cdn_file
case $os in
Linux|FreeBSD)
Linux)
case $arch in
"x86_64" | "x86" | "amd64" | "x64")
wget -O goecs.tar.gz "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/ecs_${ECS_VERSION}_linux_amd64.tar.gz"
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_linux_amd64.zip"
;;
"i386" | "i686")
wget -O goecs.tar.gz "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/ecs_${ECS_VERSION}_linux_386.tar.gz"
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_linux_386.zip"
;;
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
wget -O goecs.tar.gz "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/ecs_${ECS_VERSION}_linux_arm64.tar.gz"
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_linux_arm64.zip"
;;
*)
echo "Unsupported architecture: $arch"
@@ -97,13 +97,30 @@ goecs_check() {
;;
esac
;;
FreeBSD)
case $arch in
"x86_64" | "x86" | "amd64" | "x64")
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_freebsd_amd64.zip"
;;
"i386" | "i686")
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_freebsd_386.zip"
;;
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_freebsd_arm64.zip"
;;
*)
echo "Unsupported architecture: $arch"
exit 1
;;
esac
;;
Darwin)
case $arch in
"x86_64" | "x86" | "amd64" | "x64")
wget -O goecs.tar.gz "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/ecs_${ECS_VERSION}_linux_amd64.tar.gz"
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_amd64.zip"
;;
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
wget -O goecs.tar.gz "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/ecs_${ECS_VERSION}_linux_arm64.tar.gz"
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_arm64.zip"
;;
*)
echo "Unsupported architecture: $arch"
@@ -116,11 +133,10 @@ goecs_check() {
exit 1
;;
esac
tar -xvf goecs.tar.gz
rm -rf goecs.tar.gz
unzip goecs.zip
rm -rf goecs.zip
rm -rf README.md
rm -rf LICENSE
mv ecs goecs
sleep 1
chmod 777 goecs
rm -rf /usr/bin/goecs
@@ -300,7 +316,7 @@ env_check() {
_green "Installing fio"
${PACKAGE_INSTALL[int]} fio
fi
if ! command -v sysbench >/dev/null 2>&1; then
if ! command -v sysbench >/dev/null 2>&1 && [ "${REGEX[int]}" != "freebsd" ]; then
_green "Installing sysbench"
${PACKAGE_INSTALL[int]} sysbench
if [ $? -ne 0 ]; then