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

Reply via email to