Skip to content

Instantly share code, notes, and snippets.

@vildninja
Created February 6, 2019 22:27
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 vildninja/39c57ed842ef79dd799c23c5e7dc3ddd to your computer and use it in GitHub Desktop.
Save vildninja/39c57ed842ef79dd799c23c5e7dc3ddd to your computer and use it in GitHub Desktop.
script to locate my raspberry pi on a new local network
macaddress=XX:XX:XX:XX:XX:XX
mylocalip=$(ip addr show | egrep -o '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+' | grep -v 127.0.0.1)
echo scanning for $macaddress on $mylocalip
piip=$(sudo nmap -p 22 $mylocalip | grep -B5 $macaddress | egrep -o '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
echo found pitv on $piip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment