Created
March 21, 2015 18:02
-
-
Save cpswan/88d44d9c40e5f3d5bf88 to your computer and use it in GitHub Desktop.
Show IP address prior to login
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$METHOD" = loopback ]; then | |
exit 0 | |
fi | |
# Only run from ifup. | |
if [ "$MODE" != start ]; then | |
exit 0 | |
fi | |
cp /etc/issue-standard /etc/issue | |
/sbin/ifconfig | grep "inet addr" | grep -v "127.0.0.1" | awk '{ print $2 }' | awk -F: '{ print $2 }' >> /etc/issue | |
echo "" >> /etc/issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Goes in /etc/network/if-up.d/
Original blog post http://offbytwo.com/2008/05/09/show-ip-address-of-vm-as-console-pre-login-message.html