Last active
January 12, 2018 19:15
-
-
Save Nama/7c15db383f043df71e36 to your computer and use it in GitHub Desktop.
motd for logins. Just put in /etc/profile.d/
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 | |
| freemem=`cat /proc/meminfo|grep 'MemF'| awk '{print int($2/1024)}'` | |
| totalmem=`cat /proc/meminfo|grep 'MemT'| awk '{print int($2/1024)}'` | |
| usedmem=`echo $totalmem-$freemem | bc` | |
| echo -e " | |
| \033[1;34mHi $USER!\033[0;37m | |
| \033[0;90m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| \033[0;90m+ \033[1;94mHostname....: \033[36m$(hostname) | |
| \033[0;90m+ \033[1;94mKernel......: \033[36m$(uname -r) | |
| \033[0;90m+ \033[1;94mUptime......: \033[36m$(uptime -p) \e[0m- \033[32m$(uptime -s) | |
| \033[0;90m+ \033[1;94mCPU Temp....: \033[36m$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input | cut -c1-2)°C | |
| \033[0;90m+ \033[1;94mMemory Used.:\033[36m $usedmem MB \e[0m/ \033[32m$totalmem MB | |
| \033[0;90m+ \033[1;94mDisk........: \033[36m$(df -h | grep "sda1" | awk '{print $3}' | sed 's/.$//') GB \e[0m/ \033[32m$(df -h | grep "sda1" | awk '{print $2}' | sed 's/.$//') GB | |
| \033[0;90m+ \033[1;94mLoad........: \033[36m$(cat /proc/loadavg | awk '{print $1}')\e[0m \033[32m$(cat /proc/loadavg | awk '{print $2}')\e[1m \033[36m$(cat /proc/loadavg | awk '{print $3}') | |
| \033[0;90m+ \033[1;94mProcesses...: \033[36m$(ps -ef | wc -l | sed -e 's/^[ \t]*//') Total \e[0m- \033[32m$(ps -u "$(echo $(w -h | cut -d ' ' -f1 | sort -u))" o user= | sort | uniq -c | sort -rn | awk '{print $1}' | sed -e 's/^[ \t]*//') $USER | |
| \033[0;90m+ \033[1;94mIP Address..: \033[36m$(hostname -i) | |
| \033[0;90m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| " |
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 | |
| freemem=`cat /proc/meminfo|grep 'MemF'| awk '{print int($2/1024)}'` | |
| totalmem=`cat /proc/meminfo|grep 'MemT'| awk '{print int($2/1024)}'` | |
| usedmem=`echo $totalmem-$freemem | bc` | |
| echo -e " | |
| \033[1;34mHi $USER!\033[0;37m | |
| \033[0;90m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| \033[0;90m+ \033[1;94mHostname....: \033[36m$(hostname) | |
| \033[0;90m+ \033[1;94mKernel......: \033[36m$(uname -r) | |
| \033[0;90m+ \033[1;94mUptime......: \033[36m$(uptime -p) \e[0m- \033[32m$(uptime -s) | |
| \033[0;90m+ \033[1;94mCPU Temp....: \033[36m$(/opt/vc/bin/vcgencmd measure_temp | cut -c 6-9)°C | |
| \033[0;90m+ \033[1;94mMemory Used.:\033[36m $usedmem MB \e[0m/ \033[32m$totalmem MB | |
| \033[0;90m+ \033[1;94mDisk........: \033[36m$(df -h | grep "root" | awk '{print $3}' | sed 's/.$//') GB \e[0m/ \033[32m$(df -h | grep "root" | awk '{print $2}' | sed 's/.$//') GB | |
| \033[0;90m+ \033[1;94mLoad........: \033[36m$(cat /proc/loadavg) | |
| \033[0;90m+ \033[1;94mProcesses...: \033[36m$(ps -ef | wc -l | sed -e 's/^[ \t]*//') Total \e[0m- \033[32m$(ps -u "$(echo $(w -h | cut -d ' ' -f1 | sort -u))" o user= | sort | uniq -c | sort -rn | awk '{print $1}' | sed -e 's/^[ \t]*//') $USER | |
| \033[0;90m+ \033[1;94mIP Address..: \033[36m$(hostname -i) | |
| \033[0;90m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m | |
| " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment