asb / raspi-config

Configuration tool for the Raspberry Pi. Now maintained at https://github.com/RPi-Distro/raspi-config
Other
263 stars 328 forks source link

Display IP address #38

Open lurch opened 10 years ago

lurch commented 10 years ago

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.

Bit-notes commented 9 years ago

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.

lurch commented 9 years ago

That sed nastiness isn't necessary - you can achieve the same thing using hostname -I, as documented here.

Bit-notes commented 9 years ago

That's what you get from learning by reading stackoverflow. Thanks :)