-
Notifications
You must be signed in to change notification settings - Fork 0
/
motd
24 lines (21 loc) · 1.11 KB
/
motd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
USER=$(whoami)
DISTRO="\e[91m\e[1m$(lsb_release -si) $(lsb_release -sr) $(lsb_release -sc)\e[0m"
KERNEL="$(uname) $(uname -r)"
TIME="$(uptime -p) "
SOCKETS=$(lscpu | grep 'Socket(s)' | uniq | cut -d":" -f2 | tr -d " ")
CORES=$(grep 'cpu cores' /proc/cpuinfo | uniq | cut -d":" -f2 | tr -d " ")
CPUMODEL=$(grep 'model name' /proc/cpuinfo | uniq | cut -d":" -f2)
THREADS=$(lscpu | grep 'Thread' | uniq | cut -d":" -f2 | tr -d " ")
ALLTHREADS=$(lscpu | grep 'CPU(s)' | uniq | head -1 |cut -d":" -f2 | tr -d " ")
USEDMEM=$(free -h | awk '/^Mem:/{print $3}')
ALLMEM=$(free -h | awk '/^Mem:/{print $2}')
echo -e "Logged in as \e[32m$USER""\e[39m@\e[92m$(hostname)\e[0m, $TIME"
echo -e "$DISTRO, $KERNEL"
echo -e "$SOCKETS Sockets x $CORES Cores x $THREADS Threads (\e[1m\e[91m$ALLTHREADS total\e[0m) $CPUMODEL"
echo -e "\e[34m$USEDMEM \e[0mof \e[91m$ALLMEM\e[0m RAM used"
echo -e "--------------------------------------------------------------------------------"
echo "Currently logged in:"
echo " $(who)"
echo -e "--------------------------------------------------------------------------------"
echo -e "Date:\e[37m$(date)\e[0m"