mirror of
https://github.com/sairson/Yasso.git
synced 2026-11-02 21:54:53 +08:00
修复mac上ping执行问题
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user