Skip to content

Instantly share code, notes, and snippets.

@vildninja
Created February 6, 2019 22:27
Show Gist options
  • Select an option

  • Save vildninja/39c57ed842ef79dd799c23c5e7dc3ddd to your computer and use it in GitHub Desktop.

Select an option

Save vildninja/39c57ed842ef79dd799c23c5e7dc3ddd to your computer and use it in GitHub Desktop.

Revisions

  1. vildninja created this gist Feb 6, 2019.
    5 changes: 5 additions & 0 deletions findmypi.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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