萧十郎
我需要和你一样的东西,我已经exec.Command为我的 Raspberry Pi做了一个解决方法(使用)来检查服务器是否在线。这是实验代码out, _ := exec.Command("ping", "192.168.0.111", "-c 5", "-i 3", "-w 10").Output()if strings.Contains(string(out), "Destination Host Unreachable") { fmt.Println("TANGO DOWN")} else { fmt.Println("IT'S ALIVEEE")}