Updating MOTD

This commit is contained in:
Tyler Hale 2025-01-25 17:02:45 -07:00
parent 80c91ba8ad
commit 82dffd5b1d
Signed by: Tyler
GPG key ID: C7CC4B910D88EF96

View file

@ -20,6 +20,10 @@ PROCESSES=`ps ax | wc -l | tr -d " "`
SWAPSTAT=`free -m | tail -n 1 | awk '{print $3}'`
USAGEROOT=`df -Ph | grep /$ | awk '{print $5 " of " $2}'`
IPADDRESSES=`ip a|grep -oP "inet \K[0-9.]*(?=.*[^ ][^l][^o]$)"`
if (( $(grep -c . <<<"$IPADDRESSES") > 1 )); then
IPs=$(sed -e "s/^/ - /" <<< $IPADDRESSES)
IPADDRESSES=$'\n'$IPs
fi
{% if base_core_motd_banner != '' %}
BANNER='
@ -31,18 +35,19 @@ echo "$BANNER
{% else %}
echo "*********************************************************************
{% endif %}
- Hostname............: $HOSTNAME
- Operating System....: $OSVERSION
- Uptime..............: $UPTIMEP
- Current Time........: $CURRENTTIME
- Boot Time...........: $BOOTTIME
- Logged on users.....: $CONNECTEDUSERS
- Hostname............: $HOSTNAME
- Operating System....: $OSVERSION
- Uptime..............: $UPTIMEP
- Current Time........: $CURRENTTIME
- Boot Time...........: $BOOTTIME
- Login Sessions......: $CONNECTEDUSERS
$(who | sed "s/^/ - /")
*********************************************************************
- Running Processes...: $PROCESSES
- CPU usage...........: $LOAD1, $LOAD5, $LOAD15 (1, 5, 15 min)
- Memory usage........: $MEMORY1 / $MEMORY2 ($MEMORY4%)
- Swap in use.........: $SWAPSTAT MB
- Usage of /..........: $USAGEROOT
- IP Addresses........: $IPADDRESSES
- Running Processes...: $PROCESSES
- CPU usage...........: $LOAD1, $LOAD5, $LOAD15 (1, 5, 15 min)
- Memory usage........: $MEMORY1 / $MEMORY2 ($MEMORY4%)
- Swap in use.........: $SWAPSTAT MB
- Usage of /..........: $USAGEROOT
- IP Addresses........: $IPADDRESSES
*********************************************************************
"