From dbb6f43fc16ce8f2da8744d19b0c2e450dd7ab6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=B1=E8=88=9E=E8=80=85?= Date: Fri, 7 Jan 2022 14:56:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9ELiveTop=E5=8A=9F=E8=83=BD,?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E5=AD=98=E6=B4=BB=E6=97=B6,=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=BC=9A=E8=BE=93=E5=87=BAtop10=E7=9A=84b=E3=80=81c?= =?UTF-8?q?=E6=AE=B5ip=E5=AD=98=E6=B4=BB=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plugins/icmp.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Plugins/icmp.go b/Plugins/icmp.go index dcceb8d..f3c417c 100644 --- a/Plugins/icmp.go +++ b/Plugins/icmp.go @@ -71,18 +71,22 @@ func CheckLive(hostslist []string, Ping bool) []string { livewg.Wait() close(chanHosts) - if common.IsIPRange { + + if len(hostslist) > 1000 { arrTop, arrLen := ArrayCountValueTop(AliveHosts, common.LiveTop, true) for i := 0; i < len(arrTop); i++ { output := fmt.Sprintf("[*] LiveTop %-16s 段存活数量为: %d", arrTop[i]+".0.0/16", arrLen[i]) common.LogSuccess(output) } } - arrTop, arrLen := ArrayCountValueTop(AliveHosts, common.LiveTop, false) - for i := 0; i < len(arrTop); i++ { - output := fmt.Sprintf("[*] LiveTop %-16s 段存活数量为: %d", arrTop[i]+".0/24", arrLen[i]) - common.LogSuccess(output) + if len(hostslist) >= 200 { + arrTop, arrLen := ArrayCountValueTop(AliveHosts, common.LiveTop, false) + for i := 0; i < len(arrTop); i++ { + output := fmt.Sprintf("[*] LiveTop %-16s 段存活数量为: %d", arrTop[i]+".0/24", arrLen[i]) + common.LogSuccess(output) + } } + return AliveHosts }