Guest User

Bash menu for displaying system and hardware information

a guest
Jan 23rd, 2017
141
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # Bash Menu for System Information
  3. # Made by Ludwig Van'
  4.  
  5. PS3='What kind of information about your PC are you looking for?: '
  6. options=("Basic system information" "lshw - hardware information shorted" "lshw - full details" "CPU details" "Storage devices information" "USB controllers information" "lspci - usb ports, graphic cards, sound..." "disk partitions details" "BIOS information" "Quit")
  7. select opt in "${options[@]}"
  8. do
  9.     case $opt in
  10.         "Basic system information")
  11.             echo "Basic system information"
  12.             uname -a
  13.             break
  14.             ;;
  15.         "lshw - hardware information shorted")
  16.             echo "lshw - hardware information shorted"
  17.             lshw -short
  18.             break
  19.             ;;
  20.         "lshw - full details")
  21.             echo "lshw - full details"
  22.             lshw
  23.             break
  24.             ;;
  25.         "CPU details")
  26.             echo "CPU details"
  27.             lscpu
  28.             break
  29.             ;;
  30.         "Storage devices information")
  31.             echo "Storage devices information"
  32.             lsblk
  33.             break
  34.             ;;
  35.         "USB controllers information")
  36.             echo "USB controllers information"
  37.             lsusb
  38.             break
  39.             ;;
  40.         "lspci - usb ports, graphic cards, sound...")
  41.             echo "lspci - usb ports, graphic cards, sound..."
  42.             lspci
  43.             break
  44.             ;;
  45.         "disk partitions details")
  46.             echo "disk partitions details"
  47.             fdisk -l
  48.             break
  49.             ;;
  50.         "BIOS information")
  51.             echo "BIOS information"
  52.             dmidecode -t bios
  53.             break
  54.             ;;
  55.         "Quit")
  56.             break
  57.             ;;
  58.         *) echo invalid option;;
  59.     esac
  60. done
RAW Paste Data