Created
September 16, 2018 14:07
-
-
Save earljon/56cf85adff50d91a8cc31dd2ebc932f6 to your computer and use it in GitHub Desktop.
Find your Raspberry Pi IP Address in your 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
#!/bin/bash | |
# rpi-ip.sh | |
PI=raspberrypi.local | |
IPADDR=$( | |
/sbin/ping -c 1 $PI | | |
sed -En '1s/^PING [^ ]+ \(([0-9.]+)\): [0-9]+ data bytes$/\1/p' | |
) | |
echo "Your Raspberry Pi has an IP Address of $IPADDR" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment