-
Notifications
You must be signed in to change notification settings - Fork 1
/
sysinfo-x86
executable file
·33 lines (30 loc) · 1.24 KB
/
sysinfo-x86
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
31
32
33
#!/bin/bash
# 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:`
# display
AP="Atomic Pi"
MODEL=$(sudo dmidecode -s system-product-name)
BLD="\033[1m"
FIN="\033[0m"
if [[ "$MODEL" == "MF-001" ]]; then
echo -en "== ${BLD}${AP}${FIN}";
else
echo -en "== ${BLD}${MODEL}${FIN}";
fi
echo -e " (`uname -r`)"
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 "$NETWORK" | sed "s/^[ \t]*//" | sed "s/eth0/$ETH0 eth0/g" | sed "s/wlan0/$WLAN0 wlan0/g" | sed "s/usb0/$USB0 usb0/g"
echo -e "Uptime: " $(uptime)
exit 0