mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-10-07 08:11:14 +08:00
增加对应的子网掩码检测调用
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 本包不在main中使用,仅做测试使用
|
// 本包不在main中使用,仅做测试使用,真正调用的在 utils 中的 BasicsAndSecurityCheck
|
||||||
func Basic(language string) {
|
func Basic(language string) {
|
||||||
ipInfo, _, _ := network.NetworkCheck("both", false, language)
|
ipInfo, _, _ := network.NetworkCheck("both", false, language)
|
||||||
systemInfo := system.CheckSystemInfo(language)
|
systemInfo := system.CheckSystemInfo(language)
|
||||||
|
6
goecs.go
6
goecs.go
@@ -39,7 +39,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ecsVersion = "v0.0.83"
|
ecsVersion = "v0.0.84"
|
||||||
menuMode bool
|
menuMode bool
|
||||||
onlyChinaTest bool
|
onlyChinaTest bool
|
||||||
input, choice string
|
input, choice string
|
||||||
@@ -340,7 +340,7 @@ func main() {
|
|||||||
if basicStatus {
|
if basicStatus {
|
||||||
utils.PrintCenteredTitle("系统基础信息", width)
|
utils.PrintCenteredTitle("系统基础信息", width)
|
||||||
}
|
}
|
||||||
basicInfo, securityInfo, nt3CheckType = utils.SecurityCheck(language, nt3CheckType, securityTestStatus)
|
basicInfo, securityInfo, nt3CheckType = utils.BasicsAndSecurityCheck(language, nt3CheckType, securityTestStatus)
|
||||||
if basicStatus {
|
if basicStatus {
|
||||||
fmt.Printf(basicInfo)
|
fmt.Printf(basicInfo)
|
||||||
} else if (input == "6" || input == "9") && securityTestStatus {
|
} else if (input == "6" || input == "9") && securityTestStatus {
|
||||||
@@ -481,7 +481,7 @@ func main() {
|
|||||||
if basicStatus {
|
if basicStatus {
|
||||||
utils.PrintCenteredTitle("System-Basic-Information", width)
|
utils.PrintCenteredTitle("System-Basic-Information", width)
|
||||||
}
|
}
|
||||||
basicInfo, securityInfo, nt3CheckType = utils.SecurityCheck(language, nt3CheckType, securityTestStatus)
|
basicInfo, securityInfo, nt3CheckType = utils.BasicsAndSecurityCheck(language, nt3CheckType, securityTestStatus)
|
||||||
if basicStatus {
|
if basicStatus {
|
||||||
fmt.Printf(basicInfo)
|
fmt.Printf(basicInfo)
|
||||||
} else if (input == "6" || input == "9") && securityTestStatus {
|
} else if (input == "6" || input == "9") && securityTestStatus {
|
||||||
|
@@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"github.com/imroc/req/v3"
|
"github.com/imroc/req/v3"
|
||||||
"github.com/oneclickvirt/UnlockTests/uts"
|
"github.com/oneclickvirt/UnlockTests/uts"
|
||||||
|
"github.com/oneclickvirt/basics/ipv6"
|
||||||
"github.com/oneclickvirt/basics/system"
|
"github.com/oneclickvirt/basics/system"
|
||||||
. "github.com/oneclickvirt/defaultset"
|
. "github.com/oneclickvirt/defaultset"
|
||||||
"github.com/oneclickvirt/security/network"
|
"github.com/oneclickvirt/security/network"
|
||||||
@@ -128,12 +129,12 @@ func CheckChina(enableLogger bool) bool {
|
|||||||
return selectChina
|
return selectChina
|
||||||
}
|
}
|
||||||
|
|
||||||
// SecurityCheck 执行安全检查
|
// BasicsAndSecurityCheck 执行安全检查
|
||||||
func SecurityCheck(language, nt3CheckType string, securtyCheckStatus bool) (string, string, string) {
|
func BasicsAndSecurityCheck(language, nt3CheckType string, securtyCheckStatus bool) (string, string, string) {
|
||||||
var wgt sync.WaitGroup
|
var wgt sync.WaitGroup
|
||||||
var ipInfo, securityInfo, systemInfo string
|
var ipInfo, securityInfo, systemInfo string
|
||||||
var err error
|
var err error
|
||||||
wgt.Add(2)
|
wgt.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
defer wgt.Done()
|
defer wgt.Done()
|
||||||
ipInfo, securityInfo, err = network.NetworkCheck("both", securtyCheckStatus, language)
|
ipInfo, securityInfo, err = network.NetworkCheck("both", securtyCheckStatus, language)
|
||||||
@@ -141,12 +142,17 @@ func SecurityCheck(language, nt3CheckType string, securtyCheckStatus bool) (stri
|
|||||||
fmt.Println(err.Error())
|
fmt.Println(err.Error())
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
wgt.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
defer wgt.Done()
|
defer wgt.Done()
|
||||||
systemInfo = system.CheckSystemInfo(language)
|
systemInfo = system.CheckSystemInfo(language)
|
||||||
}()
|
}()
|
||||||
wgt.Wait()
|
wgt.Wait()
|
||||||
|
ipv6Info, errv6 := ipv6.GetIPv6Mask(language)
|
||||||
basicInfo := systemInfo + ipInfo
|
basicInfo := systemInfo + ipInfo
|
||||||
|
if errv6 == nil && ipv6Info != "" {
|
||||||
|
basicInfo += ipv6Info
|
||||||
|
}
|
||||||
if strings.Contains(ipInfo, "IPV4") && strings.Contains(ipInfo, "IPV6") {
|
if strings.Contains(ipInfo, "IPV4") && strings.Contains(ipInfo, "IPV6") {
|
||||||
uts.IPV4 = true
|
uts.IPV4 = true
|
||||||
uts.IPV6 = true
|
uts.IPV6 = true
|
||||||
|
Reference in New Issue
Block a user