Created
September 17, 2022 01:36
-
-
Save gubi/dfaa7a13c3e4487e3590ce2ba01cd161 to your computer and use it in GitHub Desktop.
Discover the local network and list available devices (and their IP address)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
is_alive_ping() | |
{ | |
ping -b -c 1 $1 > /dev/null | |
[ $? -eq 0 ] && echo Node with IP: $i is up. | |
} | |
for i in 192.168.{1..255}.{1..255} | |
do | |
is_alive_ping $i & disown | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment