From d7c732f5d156b8dba05c81f3da4372f703de3bcd Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Fri, 11 Apr 2025 22:12:09 +1200 Subject: [PATCH] =?UTF-8?q?fix:=20Remove=20additional=20bugs=20=20?= =?UTF-8?q?=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed missing " * Fixed error on LXC virtualization with fstab --- templates/dynmotd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/dynmotd b/templates/dynmotd index 1e1bb44..9098c5a 100644 --- a/templates/dynmotd +++ b/templates/dynmotd @@ -24,7 +24,9 @@ if getent group "{{ admin_group }}" | grep -qw "$(whoami)"; then #ROOT=`/usr/bin/df / -x fuse.gvfs-fuse-daemon -Ph | /usr/bin/egrep -i 'root|logvol|vda' | awk '{print $4}' | tr -d '\n'` #HOME=`/usr/bin/df /home -x fuse.gvfs-fuse-daemon -Ph | grep home | awk '{print $4}' | tr -d '\n'` #BACKUP=`/usr/bin/df -x fuse.gvfs-fuse-daemon -Ph | grep backup | awk '{print $4}' | tr -d '\n'` + if [ -f /etc/fstab ]; then FILESYSTEMS=`cat /etc/fstab | grep -v '#' | grep -v 'swap' | grep -v 'proc' | awk '{if(NF>0) {print $2}}'` + fi MEMORY=`/usr/bin/env free -m | /usr/bin/env grep "Mem" | /usr/bin/env awk '{print $2,"-",$3,"-",$4}'` SWAP=`/usr/bin/env free -m | /usr/bin/env grep "Swap" | /usr/bin/env awk '{print $2,"-",$3,"-",$4}'` PSA=`/usr/bin/env ps -Afl | /usr/bin/env wc -l` @@ -90,6 +92,7 @@ for FS in ${FILESYSTEMS}; do echo -e "$COLOR_COLUMN- ..........$RESET_COLORS..........: $COLOR_VALUE `df -H ${FS} | grep -v 'Filesystem' | grep -v '^[[:space:]]*$' | awk '{print $6 \" \" $4}'` remaining $RESET_COLORS" done {% endif %} +" echo -e " =========================================================================== "