Skip to content

Instantly share code, notes, and snippets.

@Nepherte
Last active April 20, 2023 12:54
Show Gist options
  • Save Nepherte/f3d6677ac973d0cbec3fc62d6803f647 to your computer and use it in GitHub Desktop.
Save Nepherte/f3d6677ac973d0cbec3fc62d6803f647 to your computer and use it in GitHub Desktop.
Message of the day: system info
#!/bin/bash
echo ""
echo " .~~. .~~. "
echo " '. \ ' ' / .' "
echo ""
echo " .~ .~~~..~. "
echo " : .~.'~'.~. : "
echo " ~ ( ) ( ) ~ "
echo " ( : '~'.~.'~' : )"
echo " ~ .~ ( ) ~. ~ "
echo " ( : '~' : ) "
echo " '~ .~~~. ~' "
echo " '~' "
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
let secs=$((${upSeconds}%60))
let mins=$((${upSeconds}/60%60))
let hours=$((${upSeconds}/3600%24))
let days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %d hours, %d minutes" "$days" "$hours" "$mins"`
read one five fifteen rest < /proc/loadavg
read updates < /var/run/updates-available
echo "$(tput sgr0)
`date +"%A, %e %B %Y, %r"`
`uname -srmo`
$(tput sgr0)- Uptime.............: ${UPTIME}
$(tput sgr0)- Memory.............: `free | grep Mem | awk '{print $3/1024}'` MB / `cat /proc/meminfo | grep MemTotal | awk {'print $2/1024'}` MB
$(tput sgr0)- CPU Load...........: ${one}, ${five}, ${fifteen} (1, 5, 15 min)
$(tput sgr0)- File System........: $(df -h / | grep / | awk '{ print $5 " of " $2 }') in use on /
$(tput sgr0)- IP Addresses.......: `hostname -I | /usr/bin/cut -d " " -f 1` and `curl -s ifconfig.me`
$(tput sgr0)${updates} updates can be applied immediately."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment