Refactor
* De-duplicate scripts
* Fix kernels to latest lts-xenial virt
Change-Id: I01280ad119146345eb02518ba80c2c6e8d37c40e
diff --git a/ubuntu-16.04/scripts/motd.sh b/ubuntu-16.04/scripts/motd.sh
new file mode 100644
index 0000000..ac02585
--- /dev/null
+++ b/ubuntu-16.04/scripts/motd.sh
@@ -0,0 +1,17 @@
+#!/bin/bash -xe
+# Motd
+apt-get -y install update-motd
+rm -vf /etc/update-motd.d/*
+echo "BUILD_TIMESTAMP=$(date '+%Y-%m-%d-%H-%M-%S' -u)" > /etc/image_version
+echo "BUILD_TIMESTAMP_RFC=\"$(date -u -R)\"" >> /etc/image_version
+cat << 'EOF' >> /etc/update-motd.d/00-header-mirantis
+#!/bin/sh
+#
+# 00-header - create the header of the MOTD
+#
+[ -r /etc/image_version ] && . /etc/image_version
+echo "Ubuntu 16.04 \"Xenial\" Mirantis cloud image"
+echo "Build date: ${BUILD_TIMESTAMP_RFC}"
+EOF
+chmod +x /etc/update-motd.d/00-header-mirantis
+