From 2d7a3caa4f3d9999bcb8888e8c130ca0f786c5b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Dost=C3=A1l?= Date: Tue, 17 Oct 2023 08:37:49 +0200 Subject: [PATCH] Parse os-release if possible --- motd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/motd b/motd index 2197f30..2b2cf0f 100755 --- a/motd +++ b/motd @@ -15,7 +15,8 @@ if [[ ${OSTYPE,,} =~ ^linux ]]; then loadAvg="$(awk '{ printf "%s, %s, %s", $1, $2, $3 }' /proc/loadavg)" diskUsage=$(df -h /| awk '$NF=="/"{printf "%s", $5}') memUsage=$(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }') - echo "$(uname -s) $(uname -r) $(uname -p) - Up ${upDays} days" + osRelease=$(test -f /etc/os-release && source /etc/os-release && echo -n " ${NAME} ${VERSION}") + echo "$(uname -o)${osRelease} $(uname -r | cut -d'.' -f1,2) $(uname -p) - Up ${upDays} days" echo "Load: ${loadAvg} Disk: ${diskUsage} Memory: ${memUsage}" fi