[CentOS] How to display the IP on the welcome screen
Paul Heinlein
heinlein at madboa.comTue Apr 20 15:33:35 UTC 2010
- Previous message: [CentOS] How to display the IP on the welcome screen
- Next message: [CentOS] How to display the IP on the welcome screen
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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/
- Previous message: [CentOS] How to display the IP on the welcome screen
- Next message: [CentOS] How to display the IP on the welcome screen
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list