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