Last active
October 8, 2024 17:12
-
-
Save ironwolphern/8bd84365e29288d20d73b52f5cfcb621 to your computer and use it in GitHub Desktop.
This script print a banner with logo and system information.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script print a banner with logo and system information. | |
# Need two packages: figlet and lolcat | |
# Fix: for lolcat to work properly, you have to move the binary from /usr/games/lolcat to /usr/bin/lolcat | |
# Colors | |
GREEN='\033[0;32m' | |
BLUE='\033[0;34m' | |
YELLOW='\033[0;33m' | |
NC='\033[0m' | |
LOGO='EXAMPLE' | |
MESSAGE='This is a second message banner' | |
# Banner | |
figlet -w 70 -f slant -c "${LOGO}" | lolcat -f | |
printf " Welcome to ${LOGO}'s %s Server" "$(hostname -s)" | lolcat -f | |
echo | |
echo | |
# Sysrem Information | |
printf " ${YELLOW}System Information at:${NC} ${GREEN}%s${NC}\n" "$(date)" | |
echo | |
printf "${YELLOW}System Load:\t${NC}${BLUE}%s${NC}\t\t${YELLOW}Processes:\t${BLUE}%s${NC}\n" "$(cat /proc/loadavg | awk '{print $1, $2, $3}')" "$(ps aux --no-headings | wc -l)" | |
printf "${YELLOW}Memory Usage:\t${NC}${BLUE}%s${NC}\t${YELLOW}IP Address:\t${BLUE}%s${NC}\n" "$(free -m | awk 'NR==2{printf "%s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }')" "$(hostname -I | awk '{print $1}')" | |
printf "${YELLOW}Disk Usage:\t${NC}${BLUE}%s${NC}\t\t${YELLOW}System Uptime:\t${BLUE}%s${NC}\n" "$(df -h / | awk 'NR==2{printf "%s/%s (%s)\n", $3,$2,$5}')" "$(uptime -p)" | |
# Banner 2 | |
echo | |
echo " ${LOGO} - ${MESSAGE}" | lolcat -f | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment