-
-
Save dimzon/a4209b17ef243c7b37c5 to your computer and use it in GitHub Desktop.
For showing IP Address before the login prompt on Ubuntu env. Copy the following script to /etc/network/if-up.d/ and /etc/network/if-post-down.d/ folders. And don’t forget to mark them as executables.
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
# This shell script displays hostname and IP Address of the Ubuntu machine before the login prompt. | |
# Add this file to '/etc/network/if-up.d/' and '/etc/network/if-post-down.d/' folders and mark them as executables. | |
# Display Ubuntu default information [the current version of Ubuntu]. | |
cat /etc/issue.net > /etc/issue | |
# Display the hostname. | |
hostname >> /etc/issue | |
# Display the IP Address of eth0. | |
ip address show eth0 | awk '/inet / {print $2}' | cut -d/ -f1 >> /etc/issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment