From 687de0c913e5da0898dd7809c922a407dfe5bb26 Mon Sep 17 00:00:00 2001 From: EC2 Server Date: Thu, 19 Nov 2020 14:38:29 +0000 Subject: [PATCH] bug4811: added the motd-banner file to /configuration, linked to from /etc/update-motd.d/30-banner --- configuration/motd-banner | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 configuration/motd-banner diff --git a/configuration/motd-banner b/configuration/motd-banner new file mode 100755 index 00000000000..071d87b8dac --- /dev/null +++ b/configuration/motd-banner @@ -0,0 +1,41 @@ +#!/bin/sh + +REGION=`wget -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/[a-z]$//'` +AMI_ID=`wget -q -O - http://169.254.169.254/latest/meta-data/ami-id` +AMI_INFO=`aws ec2 describe-images --region ${REGION} --image-ids "$AMI_ID"` +AMI_NAME=`echo $AMI_INFO | python -c "import sys,json; print json.load(sys.stdin)['Images'][0]['Name']"` +AMI_CREATED=`echo $AMI_INFO | python -c "import sys,json; print json.load(sys.stdin)['Images'][0]['CreationDate']"` + +INSTANCE_ID=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id` +INSTANCE_NAME_INFO=`aws ec2 describe-tags --region ${REGION} --filter "Name=resource-id,Values=$INSTANCE_ID"` +INSTANCE_AWS_NAME=`echo $INSTANCE_NAME_INFO | python -c "import sys,json; print json.load(sys.stdin)['Tags'][0]['Value']"` + +source /home/sailing/servers/server/env.sh +cat << EOF +........................................................... +/////////////////////////////////////////////////////////, +///////////////////////////////////////////////////////, +///* .*////// ///// .*/////////////, +(. /((/ (((( /((((((((, +. ,((((/.,(((( .((( /(/* ((((((, +. ./((((((((, , *(( /(((* /(((, +(. ./((* ,(. (( */*. ((, +(((* ( ((( .( /* +((((((((/ , .,/(* +(/ .*(((* (((((* +, (((/((/ (##* +##(,. ./#,,,,,/#######,,,,,,,,,(* +#################################* .*, +###############################* ,./ * +.............................. . + +Welcome to instance running image $AMI_NAME! +The image has been created at <$AMI_CREATED>. + +This instance is named <$INSTANCE_AWS_NAME> and +is running the Analytics server <$SERVER_NAME>. + +It will use a maximum of <$MEMORY> memory and is configured to +be a <$USE_ENVIRONMENT>. Please handle with love and care! + +EOF