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

  1. #!/bin/bash
  2. sysinfo () {
  3. # Removing existing bench.log
  4. rm -rf $HOME/bench.log
  5. # Reading out system information...
  6. # Reading CPU model
  7. cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' )
  8. # Reading amount of CPU cores
  9. cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo )
  10. # Reading CPU frequency in MHz
  11. freq=$( awk -F: ' /cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' )
  12. # Reading total memory in MB
  13. tram=$( free -m | awk 'NR==2 {print $2}' )
  14. # Reading Swap in MB
  15. vram=$( free -m | awk 'NR==4 {print $2}' )
  16. # Reading system uptime
  17. up=$( uptime | awk '{ $1=$2=$(NF-6)=$(NF-5)=$(NF-4)=$(NF-3)=$(NF-2)=$(NF-1)=$NF=""; print }' | sed 's/^[ \t]*//;s/[ \t]*$//' )
  18. # Reading operating system and version (simple, didn't filter the strings at the end...)
  19. opsy=$( cat /etc/issue.net | awk 'NR==1 {print}' ) # Operating System & Version
  20. arch=$( uname -m ) # Architecture
  21. lbit=$( getconf LONG_BIT ) # Architecture in Bit
  22. hn=$( hostname ) # Hostname
  23. kern=$( uname -r )
  24. # Date of benchmark
  25. bdates=$( date )
  26. echo "Benchmark started on $bdates" | tee -a $HOME/bench.log
  27. echo "Full benchmark log: $HOME/bench.log" | tee -a $HOME/bench.log
  28. echo "" | tee -a $HOME/bench.log
  29. # Output of results
  30. echo "System Info" | tee -a $HOME/bench.log
  31. echo "-----------" | tee -a $HOME/bench.log
  32. echo "Processor : $cname" | tee -a $HOME/bench.log
  33. echo "CPU Cores : $cores" | tee -a $HOME/bench.log
  34. echo "Frequency : $freq MHz" | tee -a $HOME/bench.log
  35. echo "Memory : $tram MB" | tee -a $HOME/bench.log
  36. echo "Swap : $vram MB" | tee -a $HOME/bench.log
  37. echo "Uptime : $up" | tee -a $HOME/bench.log
  38. echo "" | tee -a $HOME/bench.log
  39. echo "OS : $opsy" | tee -a $HOME/bench.log
  40. echo "Arch : $arch ($lbit Bit)" | tee -a $HOME/bench.log
  41. echo "Kernel : $kern" | tee -a $HOME/bench.log
  42. echo "" | tee -a $HOME/bench.log
  43. echo "" | tee -a $HOME/bench.log
  44. }
  45. sysinfo;