raspi-config
raspi-config copied to clipboard
Display IP address
As discussed here when the Pi boots up for the first time, raspi-config starts automatically and obscures the IP address that gets displayed. This means that in the rare scenarios where you have a monitor and ethernet connected, but don't have a keyboard connected (?!), you can't see what the Pi's IP address is in order to connect to it via SSH. Having raspi-config display the Pi's IP address would fix this.
If anyone still interested in implementing it here is command to display IPs separated by new line, excluding localhost:
ifconfig | sed -r -e '/inet addr:/!d; s/.+?inet addr:([0-9\.]*).*/\1/; /127\.0\.0\.1/d'
Please put it somewhere in raspi-config, it is really awkward to go to net map to determine ip of raspberry pi.
That sed nastiness isn't necessary - you can achieve the same thing using hostname -I
, as documented here.
That's what you get from learning by reading stackoverflow. Thanks :)