Rework for modular system

Autoadd disks to temps (only for sd*, and works on smartmontools)
Some cosmetic changes
This commit is contained in:
2020-01-14 02:18:46 +03:00
parent ff44ea7749
commit 003a32b4a2
6 changed files with 49 additions and 40 deletions

View File

@@ -1,7 +1,5 @@
#!/bin/bash
# get load averages
IFS=" " read LOAD1 LOAD5 LOAD15 <<<$(/bin/cat /proc/loadavg | awk '{ print $1,$2,$3 }')
# get free memory
IFS=" " read USED FREE TOTAL <<<$(free -htm | grep "Mem" | awk {'print $3,$4,$2'})
# get processes
@@ -11,16 +9,13 @@ PROCESS_ROOT=`echo "$PROCESS"| grep root | awk {'print $2'}`
PROCESS_USER=`echo "$PROCESS"| grep -v root | awk {'print $2'} | awk '{ SUM += $1} END { print SUM }'`
W="\e[0;39m"
G="\e[1;32m"
G="\e[1;33m"
echo -e "
${W}system info:
$W Distro......: $W`cat /etc/*release | grep "PRETTY_NAME" | cut -d "=" -f 2- | sed 's/"//g'`
$W Kernel......: $W`uname -sr`
$W Uptime......: $W`uptime -p`
$W Load........: $G$LOAD1$W (1m), $G$LOAD5$W (5m), $G$LOAD15$W (15m)
$W Processes...:$W $G$PROCESS_ROOT$W (root), $G$PROCESS_USER$W (user) | $G$PROCESS_ALL$W (total)
$W CPU.........: $W`cat /proc/cpuinfo | grep "model name" | cut -d ' ' -f3- | awk {'print $0'} | head -1`
$W Memory......: $G$USED$W used, $G$FREE$W free, $G$TOTAL$W in total$W"
$W Uptime.: $W`uptime -p | awk '{if ($1 != "test") printf("%s %s %s %s\n", $2, $3, $4, $5); }' | sed 's/,//g'`
$W Distro.: $W`cat /etc/*release | grep "PRETTY_NAME" | cut -d "=" -f 2- | sed 's/"//g'`
$W Kernel.: $W`uname -sr`
$W Proc...: $W$G$PROCESS_ROOT$W (r), $G$PROCESS_USER$W (u) | $G$PROCESS_ALL$W (t)
$W CPU....:$W`cat /proc/cpuinfo | grep "name" | cut -d : -f2 | uniq | cut -f1 -d"@" | sed 's/(TM)//;s/(R)//;s/CPU//'`
$W Memory.: $G$USED$W used | $G$TOTAL$W in total$W"