From 6465c4f5bd4757521d396628f224e3ce6b2f6094 Mon Sep 17 00:00:00 2001 From: sairson Date: Sun, 9 Jan 2022 16:27:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmac=E4=B8=8Aping=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/icmp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/icmp.go b/cmd/icmp.go index a18c569..eac0410 100644 --- a/cmd/icmp.go +++ b/cmd/icmp.go @@ -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