Find my pi on the local network

From XPUB & Lens-Based wiki
Revision as of 20:13, 7 January 2014 by Mths (talk | contribs) (Created page with "<code> #!/bin/bash # findMYPi: # Find all MY Pi's on the LAN #grep broadcast ip var1=$(ifconfig | grep inet | tail -1 | awk '{print $6}' | cut -f2 -d: | cut -f1-3 -d.) #ping...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

  1. !/bin/bash
  2. findMYPi:
  3. Find all MY Pi's on the LAN
  1. grep broadcast ip

var1=$(ifconfig | grep inet | tail -1 | awk '{print $6}' | cut -f2 -d: | cut -f1-3 -d.)

  1. ping all ip's on the network

for i in {1..255}; do ping -c 1 -W 1 $var1.$i; done

  1. grep MY Pi's

arp -a | grep "b8:27:eb"