Saturday, August 27, 2011

display specific information at boot message

echo 'Kernel : \\r' > /etc/issue
echo 'OS version : \\v' >> /etc/issue
echo 'Machine Architecture : \m' >> /etc/issue
echo 'hostname : \\n .\o' >> /etc/issue

dhclient eth0
echo 'IP Addr : ' `ifconfig eth0 | grep 'inet addr:' | awk -F: '{ print $2 }' | awk '{ print $1 }'` >> /etc/issue

Thanks
http://crazytoon.com/2008/04/22/linux-how-to-change-login-prompt-in-linux/
http://www.catonmat.net/blog/golfing-the-extraction-of-ip-addresses-from-ifconfig/

No comments:

Post a Comment