Re: How to display the IP on the welcome screen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@xxxxxxxxxx <> http://www.madboa.com/
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux