FedoraForum.org

FedoraForum.org (http://forums.fedoraforum.org/index.php)
-   Using Fedora (http://forums.fedoraforum.org/forumdisplay.php?f=7)
-   -   /etc/issue and motd customization (http://forums.fedoraforum.org/showthread.php?t=121086)

eth0g 17th August 2006 05:22 AM

/etc/issue and motd customization
 
Hey Linux Guru's,

I am building a custom system with a base of Fedora Core 5. I want to show the ip address dynamically via the /etc/issue and /etc/motd.

I have the box setup with DHCP so it will pick up a different ip each time. It's a server so, have not installed X. So i need these two files to dynamically find out the current ip after booting and print it to the screen, just like it does with the kernel version.
I now have the code, as below, but i need to know where to put it so it runs at startup, after dhcp address is picked up but before etc issue is printed to screen???? -

Code:

echo "/sbin/ifconfig eth0 | perl -wne 's/^\s*inet addr:((\d{1,3}\.){3}\d{1,3}).*$/$1/ && print;'" > /etc/issue
Please help


Cheers,

Keith

eth0g 17th August 2006 07:44 AM

Ok what i have done is put the lines below in this file /etc/init.d/network at the end of the file and it works. It's bit messy so if you have a better suggestion?:

Code:

echo 'the ip address is currently:' > /etc/issue
#then add the current ip address
/sbin/ifconfig eth0 | perl -wne 's/^\s*inet addr:((\d{1,3}\.){3}\d{1,3}).*$/$1/ && print;' >> /etc/issue



All times are GMT +1. The time now is 04:38 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.