Last active
July 9, 2017 13:01
-
-
Save K-Ko/7eb8d2e8abdf36195efe6e1d814907b9 to your computer and use it in GitHub Desktop.
Dyn. motd for debain based systems
This file contains 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 | |
### | |
### sudo wget -qO /usr/local/bin/dynmotd https://gist.github.com/K-Ko/7eb8d2e8abdf36195efe6e1d814907b9/raw/dynmotd | |
### sudo chmod +x /usr/local/bin/dynmotd | |
### echo /usr/local/bin/dynmotd >> ~/.profile | |
### | |
echo | |
uname -srvm | |
echo | |
echo $(uptime -p) since $(uptime -s) | |
echo | |
echo ----------------------------------------------------------------------------- | |
temp=/sys/class/thermal/thermal_zone0/temp | |
if [ -f $temp ]; then | |
### Raspberry Pi | |
printf " " | |
awk '{ printf "Load average: %.2f / %.2f / %.2f", $1, $2, $3 }' /proc/loadavg | |
printf " | " | |
awk '{ printf "Temperature: %.1f°C", $1/1000 }' $temp | |
else | |
printf " " | |
awk '{ printf "Load average: %.2f / %.2f / %.2f", $1, $2, $3 }' /proc/loadavg | |
fi | |
echo | |
echo ----------------------------------------------------------------------------- | |
free -h | head -n 2 | |
echo ----------------------------------------------------------------------------- | |
df -h -x tmpfs -x devtmpfs | |
echo ----------------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment