Last active
March 17, 2022 00:05
-
-
Save kwilczynski/335941ce51a1f3ca8f54 to your computer and use it in GitHub Desktop.
/etc/update-motd.d/90-vagrant -- dynamic Message of the Day with added Vagrant information (brief)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[ -f /etc/os-release-vagrant ] || exit 0 | |
# Add information about this particular Vagrant box e.g., version, etc. | |
. /etc/os-release-vagrant | |
# Calculate the level of indentation. | |
_indent() { echo "(${#1} + 75) / 2" | bc; } | |
readonly HEADER="$BUILD_NAME (${BUILDER_TYPE})" | |
readonly VERSION="Box version: ${VERSION}" | |
printf "\n%*s\n" "$(_indent "$HEADER")" "$HEADER" | |
cat <<'EOS' | |
_____ _____ _____ _____ _____ _____ _____ | |
| | | _ | __| __ | _ | | |_ _| | |
| | | | | | -| | | | | | | | |
\___/|__|__|_____|__|__|__|__|_|___| |_| | |
EOS | |
printf "%*s\n%*s\n" \ | |
"$(_indent "$BUILD_DATE")" "$BUILD_DATE" \ | |
"$(_indent "${VERSION}")" "$VERSION" | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUILD_NAME="ubuntu-14.04-amd64" | |
BUILD_NUMBER=0 | |
BUILD_TIMESTAMP=1424534915 | |
BUILD_DATE="Sat Feb 21 16:08:35 UTC 2015" | |
BUILDER_TYPE="vmware" | |
VERSION="0.1.0" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment