motd.init

Path: lib/boxgrinder-build/plugins/os/rpm-based/src/motd.init
Last Update: Wed Apr 27 16:37:28 +0000 2011

#!/bin/sh # # motd Prepares /etc/motd file # # chkconfig: 2345 99 05 # description: Prepares /etc/motd file # ### BEGIN INIT INFO # Provides: ec2 # Default-Start: 2345 # Default-Stop: 0 1 6 # Short-Description: Prepares /etc/motd file # Description: Prepares /etc/motd file ### END INIT INFO

HOSTNAME=`/bin/uname -a | awk ’{print $2}’` IP_ADDRESS=`ip addr list eth0 | grep "inet " | cut -d’ ’ -f6 | cut -d/ -f1`

echo -e "\nAppliance:\t#APPLIANCE# VERSION#\nHostname:\t$HOSTNAME\nIP Address:\t$IP_ADDRESS\n" > /etc/motd

exit 0

[Validate]