#!/bin/sh # # motd Prepares /etc/motd file # # chkconfig: 2345 99 05 # description: Prepares /etc/motd file # ### BEGIN INIT INFO # Provides: motd # Required-Start: network # 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 | head -1`
echo -e “nAppliance:t#APPLIANCE# #VERSION#nHostname:t$HOSTNAMEnIP Address:t$IP_ADDRESSn” > /etc/motd
exit 0