Sorin Srbu a écrit :
From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Patrick DERWAEL Sent: Tuesday, April 20, 2010 4:01 PM To: centos@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@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
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
This is a good step, but how do I get the contents of /etc/issue on the gui ??
Patrick Derwael Rue Hubert Larock, 20 4280 Hannut - Belgique G: +32 (0)479.80.50.79 T : +32 (0)19.63.64.45
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
On Tue, Apr 20, 2010 at 6:49 PM, Patrick Derwael patrick@derwael.be wrote:
This is a good step, but how do I get the contents of /etc/issue on the gui ??
cat /etc/issue | zenity --text-info --width 530
ps.
i'm not sure if zenity is standard in CentOS, otherwise install EPEL repo.
Hi,
Add the content of the file /etc/issue in the file /etc/gdm/custom.conf . See the line :
.... ..... ..... [gui]
[greeter] TitleBar=true LockPosition=false ConfigAvailable=false BackgroundType=1 BackgroundImage=YOUR BACKGROUND IMAGE Logo=YOUR LOGO DefaultWelcome=false Welcome=%s: %r - %n InfoMsgFile=/etc/issue <--------------ADD HERE THE FILE Use24Clock=true
.... ....
Restart X11, and a new window will be appear with the content of the file /etc/issue
Regards.
-----Message d'origine----- De : centos-bounces@centos.org [mailto:centos-bounces@centos.org] De la part de Patrick Derwael Envoyé : mardi 20 avril 2010 19:49 À : 'CentOS mailing list' Objet : Re: [CentOS] How to display the IP on the welcome screen
This is a good step, but how do I get the contents of /etc/issue on the gui ??
Patrick Derwael Rue Hubert Larock, 20 4280 Hannut - Belgique G: +32 (0)479.80.50.79 T : +32 (0)19.63.64.45
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
MOKRANI Rachid a écrit :
Hi,
Add the content of the file /etc/issue in the file /etc/gdm/custom.conf . See the line :
.... ..... ..... [gui]
[greeter] TitleBar=true LockPosition=false ConfigAvailable=false BackgroundType=1 BackgroundImage=YOUR BACKGROUND IMAGE Logo=YOUR LOGO DefaultWelcome=false Welcome=%s: %r - %n InfoMsgFile=/etc/issue <--------------ADD HERE THE FILE Use24Clock=true
.... ....
Restart X11, and a new window will be appear with the content of the file /etc/issue
Regards.
-----Message d'origine----- De : centos-bounces@centos.org [mailto:centos-bounces@centos.org] De la part de Patrick Derwael Envoyé : mardi 20 avril 2010 19:49 À : 'CentOS mailing list' Objet : Re: [CentOS] How to display the IP on the welcome screen
This is a good step, but how do I get the contents of /etc/issue on the gui ??
Patrick Derwael Rue Hubert Larock, 20 4280 Hannut - Belgique G: +32 (0)479.80.50.79 T : +32 (0)19.63.64.45
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
Nice trick, I'll try it thanks ;)