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

Tue Apr 20 14:28:07 UTC 2010
Georghy <fusco at wanagain.net>

Sorin Srbu a écrit :
> From: centos-bounces at centos.org [mailto:centos-bounces at centos.org] On Behalf
> Of Patrick DERWAEL
> Sent: Tuesday, April 20, 2010 4:01 PM
> To: centos at centos.org
> Subject: [CentOS] How to display the IP on the welcome screen
>
> Hi all,
> I'm running CentOS 5.4 in a VMware guest, with the host connected to a DHCP
> enabled LAN
> When CentOS comes up, I would like to see the IP adress displayed on the
> welcome screen.
> This would save me the hassle of logging in the VM, getting the IP, and
> logging off before finally ssh'ing to the VM.
>
> =============
>
> Is this to be shown on the GUI welcome screen or when you eg ssh in?
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>   
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

-- 
Cordialement, / Greetings,
Georghy FUSCO