[CentOS] How to display the IP on the welcome screen

Tue Apr 20 15:33:35 UTC 2010
Paul Heinlein <heinlein at madboa.com>

On Tue, 20 Apr 2010, Georghy wrote:

> try a bash script like the following :
>
> #!/bin/sh
> ADRESS=`ifconfig | grep "inet addr" | awk '{print $2}' | sed s/addr:// |
> head -n 1`
> echo "The IP adress is : $ADRESS." > /etc/issue

Or, if you'd rather use the iproute toolset rather than ifconfig:

ip -o -f inet addr show dev eth0 | awk '{print $4}' | cut -d/ -f1

-- 
Paul Heinlein <> heinlein at madboa.com <> http://www.madboa.com/