Alter format of Debian version in MOTD

This commit is contained in:
Joshua Boniface
2023-01-17 10:48:41 -05:00
parent 3ee4e7cd3f
commit 00005c62d6
2 changed files with 14 additions and 1 deletions

View File

@ -5,9 +5,16 @@
set -o errexit
# Title-case generator
tc() { set ${*,,} ; echo ${*^} ; }
TMPFILE=$(mktemp)
TGTFILE=/run/pvc-motd.dynamic
DEBVER="$( grep 'PRETTY_NAME=' /etc/os-release | awk -F'"' '{ print $2 }' )"
NAME="$( grep '^NAME=' /etc/os-release | awk -F'"' '{ print $2 }' )"
VERSION_ID="$( grep '^VERSION_ID=' /etc/os-release | awk -F'"' '{ print $2 }' )"
VERSION_CODENAME="$( grep '^VERSION_CODENAME=' /etc/os-release | awk -F'=' '{ print $2 }' )"
DEBVER="${NAME} ${VERSION_ID} \"$(tc ${VERSION_CODENAME} )\""
echo >> $TMPFILE
echo -e "\033[01;34mParallel Virtual Cluster \033[01;36m(${DEBVER})\033[0m" >> $TMPFILE