mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-09-30 21:22:11 +08:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ffb9bfdf7f | ||
![]() |
17e96a94fe | ||
![]() |
b16b22c117 | ||
![]() |
9a6879207f | ||
![]() |
8e66e5c801 | ||
![]() |
47d84ac3dd | ||
![]() |
073a894e26 | ||
![]() |
7a92e6688e | ||
![]() |
971a2c66c7 |
2
.github/workflows/main.yaml
vendored
2
.github/workflows/main.yaml
vendored
@@ -12,6 +12,8 @@ jobs:
|
|||||||
# 1.20 是 Windows 7/8 Server 2008/2012 最后一个支持版本
|
# 1.20 是 Windows 7/8 Server 2008/2012 最后一个支持版本
|
||||||
image: goreleaser/goreleaser-cross:v1.20
|
image: goreleaser/goreleaser-cross:v1.20
|
||||||
steps:
|
steps:
|
||||||
|
- run: |
|
||||||
|
git config --global --add safe.directory /__w/ecs/ecs
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
10
README.md
10
README.md
@@ -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
|
测试支持的架构: 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] 测试网速[基于[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)]
|
- [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)
|
Enable/Disable speed test (default true)
|
||||||
-spnum int
|
-spnum int
|
||||||
Set the number of servers per operator for speed test (default 2)
|
Set the number of servers per operator for speed test (default 2)
|
||||||
|
-upload
|
||||||
|
Enable/Disable upload the result (default true)
|
||||||
-ut
|
-ut
|
||||||
Enable/Disable unlock media test (default true)
|
Enable/Disable unlock media test (default true)
|
||||||
-v Display version information
|
-v Display version information
|
||||||
@@ -188,7 +190,7 @@ Usage: goecs [options]
|
|||||||
|
|
||||||
https://github.com/oneclickvirt/ecs/releases
|
https://github.com/oneclickvirt/ecs/releases
|
||||||
|
|
||||||
找其中最新的版本,按照对应架构下载对应的 .tar.gz 文件,解压后文件夹内有一个exe文件
|
找其中最新的版本,按照对应架构下载对应的 .zip 文件,解压后文件夹内有一个exe文件
|
||||||
|
|
||||||
选择该exe文件,右键点击选择管理员模式运行(非管理员模式运行无法进行硬件测试),唤起菜单自选
|
选择该exe文件,右键点击选择管理员模式运行(非管理员模式运行无法进行硬件测试),唤起菜单自选
|
||||||
|
|
||||||
|
12
README_EN.md
12
README_EN.md
@@ -12,19 +12,19 @@ Shell version: https://github.com/spiritLHLS/ecs/blob/main/README_EN.md
|
|||||||
|
|
||||||
## Supported Systems and Architectures
|
## Supported Systems and Architectures
|
||||||
|
|
||||||
Architectures supported for compilation: amd64, arm, arm64, 386, s390x、ppc64、ppc64le、riscv64
|
Architectures supported for compilation: amd64、arm、arm64、386、s390x、mips、mipsle、s390x、riscv64
|
||||||
|
|
||||||
Tested architectures: amd64, arm64
|
Tested architectures: amd64, arm64
|
||||||
|
|
||||||
More architectures please test by yourself
|
More architectures please test by yourself
|
||||||
|
|
||||||
Compilation support: Linux, Windows, FreeBSD, OpenBSD
|
Compilation support: Linux, Windows、FreeBSD、OpenBSD
|
||||||
|
|
||||||
Tested on: Linux, Windows
|
Tested on: Linux, Windows
|
||||||
|
|
||||||
More systems to be tested
|
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
|
## 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] 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)]
|
- [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
|
### one-click command
|
||||||
|
|
||||||
@@ -165,6 +165,8 @@ Usage: goecs [options]
|
|||||||
Enable/Disable speed test (default true)
|
Enable/Disable speed test (default true)
|
||||||
-spnum int
|
-spnum int
|
||||||
Set the number of servers per operator for speed test (default 2)
|
Set the number of servers per operator for speed test (default 2)
|
||||||
|
-upload
|
||||||
|
Enable/Disable upload the result (default true)
|
||||||
-ut
|
-ut
|
||||||
Enable/Disable unlock media test (default true)
|
Enable/Disable unlock media test (default true)
|
||||||
-v Display version information
|
-v Display version information
|
||||||
@@ -176,7 +178,7 @@ Download the compressed file with the exe file
|
|||||||
|
|
||||||
https://github.com/oneclickvirt/ecs/releases
|
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.
|
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.
|
||||||
|
|
||||||
|
20
goecs.go
20
goecs.go
@@ -37,7 +37,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ecsVersion = "v0.0.47"
|
ecsVersion = "v0.0.49"
|
||||||
menuMode bool
|
menuMode bool
|
||||||
onlyChinaTest bool
|
onlyChinaTest bool
|
||||||
input, choice string
|
input, choice string
|
||||||
@@ -252,10 +252,10 @@ func main() {
|
|||||||
securityTestStatus = false
|
securityTestStatus = false
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
startTime time.Time
|
startTime time.Time
|
||||||
wg1, wg2 sync.WaitGroup
|
wg1, wg2, wg3 sync.WaitGroup
|
||||||
basicInfo, securityInfo, emailInfo, mediaInfo string
|
basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo string
|
||||||
output, tempOutput string
|
output, tempOutput string
|
||||||
)
|
)
|
||||||
// 启动一个goroutine来等待信号,内置计时器
|
// 启动一个goroutine来等待信号,内置计时器
|
||||||
go func() {
|
go func() {
|
||||||
@@ -308,6 +308,13 @@ func main() {
|
|||||||
disktest.DiskTest(language, diskTestMethod, diskTestPath, diskMultiCheck)
|
disktest.DiskTest(language, diskTestMethod, diskTestPath, diskMultiCheck)
|
||||||
}
|
}
|
||||||
}, tempOutput, output)
|
}, tempOutput, output)
|
||||||
|
if onlyChinaTest || pingTestStatus {
|
||||||
|
wg3.Add(1)
|
||||||
|
go func() {
|
||||||
|
defer wg3.Done()
|
||||||
|
ptInfo = pt.PingTest()
|
||||||
|
}()
|
||||||
|
}
|
||||||
if emailTestStatus {
|
if emailTestStatus {
|
||||||
wg2.Add(1)
|
wg2.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
@@ -365,7 +372,8 @@ func main() {
|
|||||||
output = utils.PrintAndCapture(func() {
|
output = utils.PrintAndCapture(func() {
|
||||||
if onlyChinaTest || pingTestStatus {
|
if onlyChinaTest || pingTestStatus {
|
||||||
utils.PrintCenteredTitle("三网ICMP的PING值检测", width)
|
utils.PrintCenteredTitle("三网ICMP的PING值检测", width)
|
||||||
pt.PingTest()
|
wg3.Wait()
|
||||||
|
fmt.Println(ptInfo)
|
||||||
}
|
}
|
||||||
}, tempOutput, output)
|
}, tempOutput, output)
|
||||||
}
|
}
|
||||||
|
36
goecs.sh
36
goecs.sh
@@ -80,16 +80,16 @@ goecs_check() {
|
|||||||
cdn_urls=("https://cdn0.spiritlhl.top/" "http://cdn3.spiritlhl.net/" "http://cdn1.spiritlhl.net/" "http://cdn2.spiritlhl.net/")
|
cdn_urls=("https://cdn0.spiritlhl.top/" "http://cdn3.spiritlhl.net/" "http://cdn1.spiritlhl.net/" "http://cdn2.spiritlhl.net/")
|
||||||
check_cdn_file
|
check_cdn_file
|
||||||
case $os in
|
case $os in
|
||||||
Linux|FreeBSD)
|
Linux)
|
||||||
case $arch in
|
case $arch in
|
||||||
"x86_64" | "x86" | "amd64" | "x64")
|
"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")
|
"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")
|
"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"
|
echo "Unsupported architecture: $arch"
|
||||||
@@ -97,13 +97,30 @@ goecs_check() {
|
|||||||
;;
|
;;
|
||||||
esac
|
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)
|
Darwin)
|
||||||
case $arch in
|
case $arch in
|
||||||
"x86_64" | "x86" | "amd64" | "x64")
|
"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")
|
"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"
|
echo "Unsupported architecture: $arch"
|
||||||
@@ -116,11 +133,10 @@ goecs_check() {
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
tar -xvf goecs.tar.gz
|
unzip goecs.zip
|
||||||
rm -rf goecs.tar.gz
|
rm -rf goecs.zip
|
||||||
rm -rf README.md
|
rm -rf README.md
|
||||||
rm -rf LICENSE
|
rm -rf LICENSE
|
||||||
mv ecs goecs
|
|
||||||
sleep 1
|
sleep 1
|
||||||
chmod 777 goecs
|
chmod 777 goecs
|
||||||
rm -rf /usr/bin/goecs
|
rm -rf /usr/bin/goecs
|
||||||
@@ -300,7 +316,7 @@ env_check() {
|
|||||||
_green "Installing fio"
|
_green "Installing fio"
|
||||||
${PACKAGE_INSTALL[int]} fio
|
${PACKAGE_INSTALL[int]} fio
|
||||||
fi
|
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"
|
_green "Installing sysbench"
|
||||||
${PACKAGE_INSTALL[int]} sysbench
|
${PACKAGE_INSTALL[int]} sysbench
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
Reference in New Issue
Block a user