You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

45 lines
1.9 KiB

#!/bin/bash
sysinfo () {
# Removing existing bench.log
rm -rf $HOME/bench.log
# Reading out system information...
# Reading CPU model
cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' )
# Reading amount of CPU cores
cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo )
# Reading CPU frequency in MHz
freq=$( awk -F: ' /cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' )
# Reading total memory in MB
tram=$( free -m | awk 'NR==2 {print $2}' )
# Reading Swap in MB
vram=$( free -m | awk 'NR==4 {print $2}' )
# Reading system uptime
up=$( uptime | awk '{ $1=$2=$(NF-6)=$(NF-5)=$(NF-4)=$(NF-3)=$(NF-2)=$(NF-1)=$NF=""; print }' | sed 's/^[ \t]*//;s/[ \t]*$//' )
# Reading operating system and version (simple, didn't filter the strings at the end...)
opsy=$( cat /etc/issue.net | awk 'NR==1 {print}' ) # Operating System & Version
arch=$( uname -m ) # Architecture
lbit=$( getconf LONG_BIT ) # Architecture in Bit
hn=$( hostname ) # Hostname
kern=$( uname -r )
# Date of benchmark
bdates=$( date )
echo "Benchmark started on $bdates" | tee -a $HOME/bench.log
echo "Full benchmark log: $HOME/bench.log" | tee -a $HOME/bench.log
echo "" | tee -a $HOME/bench.log
# Output of results
echo "System Info" | tee -a $HOME/bench.log
echo "-----------" | tee -a $HOME/bench.log
echo "Processor : $cname" | tee -a $HOME/bench.log
echo "CPU Cores : $cores" | tee -a $HOME/bench.log
echo "Frequency : $freq MHz" | tee -a $HOME/bench.log
echo "Memory : $tram MB" | tee -a $HOME/bench.log
echo "Swap : $vram MB" | tee -a $HOME/bench.log
echo "Uptime : $up" | tee -a $HOME/bench.log
echo "" | tee -a $HOME/bench.log
echo "OS : $opsy" | tee -a $HOME/bench.log
echo "Arch : $arch ($lbit Bit)" | tee -a $HOME/bench.log
echo "Kernel : $kern" | tee -a $HOME/bench.log
echo "" | tee -a $HOME/bench.log
echo "" | tee -a $HOME/bench.log
}
sysinfo;