Add pve2/root/utilities/pingsweep.sh
This commit is contained in:
10
pve2/root/utilities/pingsweep.sh
Normal file
10
pve2/root/utilities/pingsweep.sh
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user