From 7b3ae9139ce42b552dc8007d80846f6079eeaba6 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 27 Mar 2025 11:51:47 -0700 Subject: [PATCH] Add pve2/root/utilities/pingsweep.sh --- pve2/root/utilities/pingsweep.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 pve2/root/utilities/pingsweep.sh diff --git a/pve2/root/utilities/pingsweep.sh b/pve2/root/utilities/pingsweep.sh new file mode 100644 index 0000000..6c3e3ff --- /dev/null +++ b/pve2/root/utilities/pingsweep.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Scan the local network (192.168.1.0/24) for active hosts using ICMP ping, +# displaying only hosts that respond with their IP address and response time. + +for ip in $(seq 1 254); do + ping -c 1 -W 1 192.168.1.$ip | grep "64 bytes" | sed -E "s/^.*from (.*): icmp_seq=1 ttl=.* time=(.*) ms/192.168.1.$(printf '%3d' $ip) \2 ms/" & +done | sort -t. -k1,1n -k2,2n -k3,3n -k4,4n + +wait