1
0
mirror of https://github.com/sairson/Yasso.git synced 2026-11-02 21:54:53 +08:00

修复mac上ping执行问题

This commit is contained in:
sairson
2022-01-09 16:27:09 +08:00
parent 9ef5cac578
commit 6465c4f5bd

View File

@@ -76,9 +76,9 @@ func ping(ip string) bool {
case "linux":
cmd = exec.Command("/bin/bash", "-c", "ping -c 1 -w 1 "+ip+" >/dev/null && echo true || echo false")
case "darwin":
cmd = exec.Command("/bin/bash", "-c", "ping -c 1 -w 1 "+ip+" >/dev/null && echo true || echo false")
cmd = exec.Command("/bin/bash", "-c", "ping -c 1 "+ip+" >/dev/null && echo true || echo false")
default:
cmd = exec.Command("/bin/bash", "-c", "ping -c 1 -w 1 "+ip+" >/dev/null && echo true || echo false")
cmd = exec.Command("/bin/bash", "-c", "ping -c 1"+ip+" >/dev/null && echo true || echo false")
}
info := bytes.Buffer{}
cmd.Stdout = &info