#!/bin/bash
# Display IP address on console login screen
# This script updates /etc/issue with the current IP address

# Get the first non-loopback IP address
IP=$(hostname -I | awk '{print $1}')

# If no IP is found, display a message
if [ -z "$IP" ]; then
    IP="No IP address assigned"
fi

# Update /etc/issue with IP information
cat > /etc/issue << EOF
Ubuntu \n \l

IP Address: $IP

EOF
