Created
February 6, 2019 22:27
-
-
Save vildninja/39c57ed842ef79dd799c23c5e7dc3ddd to your computer and use it in GitHub Desktop.
script to locate my raspberry pi on a new local network
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
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