Skip to content

Instantly share code, notes, and snippets.

@dimzon
Forked from P7h/show-ip-address.sh
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimzon/a4209b17ef243c7b37c5 to your computer and use it in GitHub Desktop.
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 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