News:

The Latest electronic and computer Tips that work!

Main Menu

Display IP address at boot

Started by branx86, December 23, 2015, 05:41:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

branx86

This script goes in etc/rc.local to show ip address at boot up.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
printf "My IP address is %s\n\nRaspbian GNU/Linux\n\n" "$_IP" > /etc/issue
else
  printf "Raspbian GNU/Linux\n\n" > /etc/issue
fi

exit 0