Skip to content

Instantly share code, notes, and snippets.

@gubi
Created September 17, 2022 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gubi/dfaa7a13c3e4487e3590ce2ba01cd161 to your computer and use it in GitHub Desktop.
Save gubi/dfaa7a13c3e4487e3590ce2ba01cd161 to your computer and use it in GitHub Desktop.
Discover the local network and list available devices (and their IP address)
#!/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