Created
July 13, 2015 16:43
-
-
Save viegelinsch/c21fd3832bfc2cf9802e to your computer and use it in GitHub Desktop.
Add current IP to /etc/issue (aka linux login greeting)
This file contains 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 | |
# file: /etc/network/if-up.d/add-ip-to-etc-issue | |
# source: "stolen" somewhere | |
if [ "$METHOD" = loopback ]; then | |
exit 0 | |
fi | |
# Only run from ifup. | |
if [ "$MODE" != start ]; then | |
exit 0 | |
fi | |
cp /etc/issue.orig /etc/issue | |
/sbin/ifconfig eth1 | grep "inet addr" | awk '{ print $2 }' | awk -F: '{ print "Current IP: " $2 }' >> /etc/issue | |
echo "" >> /etc/issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment