--[ IP at logonprompt ]

A script that will rewrite /etc/issue with the IP address when the network interface is brought up.



/sbin/ifconfig | grep "inet addr" | grep -v "127.0.0.1" | awk '{ print $2 }' | awk -F: '{ print $2 }'

The above script will run ifconfig and print out the IP address (after filtering out the localhost interface). Save this script to /usr/local/bin/get-ip-address.

To get it into /etc/issue, copy /etc/issue to /etc/issue-standard then create this script that runs when de network interface is up. It will overwrite the /etc/issue file with the contents of the issue-standard file and the IP.

Save the following script as /etc/network/if-up.d/show-ip-address and chmod it to 0755

#!/bin/sh
if [ "$METHOD" = loopback ]; then
    exit 0
fi

# Only run from ifup.
if [ "$MODE" != start ]; then
    exit 0
fi

cp /etc/issue-standard /etc/issue
/usr/local/bin/get-ip-address >> /etc/issue
echo "" >> /etc/issue