Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed Oct 5, 2024
1 parent aa1896e commit efa1189
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sp/sp.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ func OfficialAvailableTest() error {
spvCheck := exec.Command("speedtest", "--version")
output, err := spvCheck.CombinedOutput()
if err != nil {
if model.EnableLoger {
Logger.Info(err.Error())
}
return err
} else {
version := strings.Split(string(output), "\n")[0]
if strings.Contains(version, "Speedtest by Ookla") &&
!strings.Contains(string(output), "not valid") &&
!strings.Contains(string(output), "err") {
!strings.Contains(string(output), "err") &&
!strings.Contains(string(output), "Kommando nicht gefunden") {
// 此时确认可使用speedtest命令进行测速
return nil
}
Expand Down

0 comments on commit efa1189

Please sign in to comment.