mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-10-05 07:17:01 +08:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a73dbf2d0b | ||
![]() |
b38dd713d9 | ||
![]() |
e66ef1f106 |
22
goecs.go
22
goecs.go
@@ -40,7 +40,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
ecsVersion = "v0.1.77"
|
||||
ecsVersion = "v0.1.79"
|
||||
menuMode bool
|
||||
onlyChinaTest bool
|
||||
input, choice string
|
||||
@@ -100,7 +100,7 @@ func getMenuChoice(language string) string {
|
||||
if re.MatchString(input) {
|
||||
inChoice := input
|
||||
switch inChoice {
|
||||
case "1", "2", "3", "4", "5", "6", "7", "8", "9", "10":
|
||||
case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10":
|
||||
return inChoice
|
||||
default:
|
||||
if language == "zh" {
|
||||
@@ -582,7 +582,6 @@ func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3, wg4, wg5 *syn
|
||||
go func() {
|
||||
defer wg4.Done()
|
||||
backtraceInfo = utils.PrintAndCapture(func() {
|
||||
utils.PrintCenteredTitle("上游及回程线路检测", width)
|
||||
upstreams.UpstreamsCheck()
|
||||
}, "", "")
|
||||
}()
|
||||
@@ -592,7 +591,6 @@ func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3, wg4, wg5 *syn
|
||||
go func() {
|
||||
defer wg5.Done()
|
||||
nt3Info = utils.PrintAndCapture(func() {
|
||||
utils.PrintCenteredTitle("三网回程路由检测", width)
|
||||
nexttrace.NextTrace3Check(language, nt3Location, nt3CheckType)
|
||||
}, "", "")
|
||||
}()
|
||||
@@ -819,20 +817,22 @@ func runEmailTests(wg2 *sync.WaitGroup, emailInfo *string, output, tempOutput st
|
||||
func runNetworkTests(wg3, wg4, wg5 *sync.WaitGroup, ptInfo, backtraceInfo, nt3Info *string, output, tempOutput string, outputMutex *sync.Mutex) string {
|
||||
outputMutex.Lock()
|
||||
defer outputMutex.Unlock()
|
||||
if wg4 != nil {
|
||||
wg4.Wait()
|
||||
}
|
||||
if wg5 != nil {
|
||||
wg5.Wait()
|
||||
}
|
||||
return utils.PrintAndCapture(func() {
|
||||
if backtraceStatus && !onlyChinaTest && *backtraceInfo != "" {
|
||||
if wg4 != nil {
|
||||
wg4.Wait()
|
||||
}
|
||||
utils.PrintCenteredTitle("上游及回程线路检测", width)
|
||||
fmt.Print(*backtraceInfo)
|
||||
}
|
||||
if nt3Status && !onlyChinaTest && *nt3Info != "" {
|
||||
if wg5 != nil {
|
||||
wg5.Wait()
|
||||
}
|
||||
utils.PrintCenteredTitle("三网回程路由检测", width)
|
||||
fmt.Print(*nt3Info)
|
||||
}
|
||||
if onlyChinaTest || pingTestStatus {
|
||||
if (onlyChinaTest || pingTestStatus) && *ptInfo != "" {
|
||||
wg3.Wait()
|
||||
utils.PrintCenteredTitle("三网ICMP的PING值检测", width)
|
||||
fmt.Println(*ptInfo)
|
||||
|
6
goecs.sh
6
goecs.sh
@@ -143,7 +143,7 @@ goecs_check() {
|
||||
os=$(uname -s 2>/dev/null || echo "Unknown")
|
||||
arch=$(uname -m 2>/dev/null || echo "Unknown")
|
||||
check_china
|
||||
ECS_VERSION="0.1.76"
|
||||
ECS_VERSION="0.1.77"
|
||||
for api in \
|
||||
"https://api.github.com/repos/oneclickvirt/ecs/releases/latest" \
|
||||
"https://githubapi.spiritlhl.workers.dev/repos/oneclickvirt/ecs/releases/latest" \
|
||||
@@ -155,8 +155,8 @@ goecs_check() {
|
||||
sleep 1
|
||||
done
|
||||
if [ -z "$ECS_VERSION" ]; then
|
||||
_yellow "Unable to get version info, using default version 0.1.76"
|
||||
ECS_VERSION="0.1.76"
|
||||
_yellow "Unable to get version info, using default version 0.1.77"
|
||||
ECS_VERSION="0.1.77"
|
||||
fi
|
||||
version_output=""
|
||||
for cmd_path in "goecs" "./goecs" "/usr/bin/goecs" "/usr/local/bin/goecs"; do
|
||||
|
Reference in New Issue
Block a user