-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path20-x86-sysinfo
executable file
·30 lines (28 loc) · 1.23 KB
/
20-x86-sysinfo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# depends: lm-sensors
# variables
CPU0=`lscpu | grep "Model name" | sed -n 1p | sed 's/Model name://g'`
CPUT=$(sensors | sed -rn 's/.*Core 0:\s+.([0-9.]+).*/\1°C/p')
NETWORK=$(ip -o -4 -br a | grep -v '^lo'| sed 's/^/ /' | sed 's/\/..//' | sed -r '1s/\s+/ /g' | sed -r '2s/\s+/ /g')
ETH0=`echo -e Wired:`
WLAN0=`echo -e Wireless:`
USB0=`echo -e Tether:`
# display
echo -e "== DISK"
df -h | egrep '(Filesystem)|(/dev/mmc)|(/dev/root)|(/dev/sd)|(/dev/nvme)'
echo ""
echo -e "== NETWORK"
echo -e "Hostname: $(hostname)"
echo -e "$NETWORK" | sed "s/^[ \t]*//" | sed "s/eth0/$ETH0 eth0/g" | sed "s/wlan0/$WLAN0 wlan0/g" | sed "s/usb0/$USB0 usb0/g"
echo ""
echo -e "== SYSTEM"
if [[ -f "/sys/devices/system/cpu/present" ]]; then
echo -en "Processor: " $CPU0; echo -e " $CPUT";
fi
echo -e "Online: " $(lscpu | grep -w "On-line CPU(s) list:" | sed "s/On-line CPU(s) list:/ /g" | sed -e "s/\s\{3,\}//g")
echo -e "Governor: " $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
if [[ -f "/proc/meminfo" ]]; then
echo -e "Memory: " $(free -h | sed 's/i//g' | sed 's/Mem://g' | awk '{print $1" "$2}' | sed -n 'n;p')
fi
echo -e "Entropy: " $(cat /proc/sys/kernel/random/entropy_avail)
echo -e "Uptime: " $(uptime)