Advertisement
Guest User

System data v1.0 – Beta

a guest
Aug 6th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.55 KB | None | 0 0
  1. #!/bin/bash
  2. # -*- ENCODING: UTF-8 -*-
  3.  
  4.  
  5. # System Data v1.0 beta
  6. # By: xBalBan
  7. # Web: www.xbalban.zz.mu
  8. # Reportes / Aportes: xbalban@hotmail.com
  9. #                   www.fb.com/CyberpunkLinux
  10. # Fecha: 05/08/2015
  11.  
  12. # Copyright © 2015 xBalBan.
  13. # Permission is granted to copy, distribute and/or modify this document
  14. # under the terms of the GNU Free Documentation License, Version 1.3
  15. # or any later version published by the Free Software Foundation;
  16. # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
  17. # A copy of the license is included in the section entitled “GNU
  18. # Free Documentation License”.
  19.  
  20. function fabricante(){
  21.     echo ---------------------
  22.     echo -e "\e[1;31mFabricante del equipo:\e[0m"
  23.     dmidecode -s system-manufacturer
  24.     echo ---------------------
  25.     echo -e "\e[1;31mNombre del producto:\e[0m"
  26.     dmidecode -s system-product-name
  27.     echo ---------------------
  28.     echo -e "\e[1;31mVersión del producto:\e[0m"
  29.     dmidecode -s system-version
  30.     echo ---------------------
  31.     echo -e "\e[1;31mNúmero de serie del equipo:\e[0m"
  32.     dmidecode -s system-serial-number
  33.     echo ---------------------
  34.     echo -e "\e[1;31mSKU (Stock Keeping Unit) ó P/N (Part Number) del producto:\e[0m"
  35.     dmidecode | grep -i sku
  36. }
  37.  
  38. function procesador(){
  39.     echo ---------------------
  40.     echo -e "\e[1;31mNombre del fabricante, modelo, y velocidad:\e[0m"
  41.     grep 'vendor_id' /proc/cpuinfo ; grep 'model name' /proc/cpuinfo ; grep 'cpu MHz' /proc/cpuinfo
  42.     echo ---------------------
  43.     echo -e "\e[1;31mArquitectura (32 o 64 bits):\e[0m"
  44.     uname -m
  45. }
  46.  
  47. function ram(){
  48.     echo ---------------------
  49.     echo -e "\e[1;31mTotal memoria RAM/SWAP:\e[0m"
  50.     free -o -m
  51. }
  52.  
  53. function kernel(){
  54.     echo ---------------------
  55.     echo -e "\e[1;31mNombre y versión del kernel:\e[0m"
  56.     uname -sr
  57. }
  58.  
  59. function shell(){
  60.     echo ---------------------
  61.     echo -e "\e[1;31mShell que usa el sistema:\e[0m "
  62.     echo $SHELL
  63. }
  64.  
  65. function distro(){
  66.     echo ---------------------
  67.     echo -e "\e[1;31mNombre, versión y nombre clave de la distribución:\e[0m"
  68.     lsb_release -idc
  69.  
  70. }
  71.  
  72. function usuario(){
  73.     echo ---------------------
  74.     echo -e "\e[1;31mNombre del usuario actual:\e[0m"
  75.     echo $USER
  76.     echo ---------------------
  77.     echo -e "\e[1;31mNombre del equipo:\e[0m"
  78.     echo $HOSTNAME
  79.     echo ---------------------
  80.     echo -e "\e[1;31mDirectorio bas del usuario actual:\e[0m"
  81.     echo $HOME
  82. }
  83.  
  84. function logs(){
  85.     echo ------------------------------------------------------
  86.     echo -e "\e[1;31m30 últimas líneas del buffer del kernel:\e[0m"
  87.     dmesg | tail -30
  88.     echo ------------------------------------------------------
  89.     echo ------------------------------------------------------
  90.     echo -e "\e[1;31mBuffer del kernel:\e[0m"
  91.     dmesg
  92.     echo ------------------------------------------------------
  93.     echo ------------------------------------------------------
  94.     echo -e "\e[1;31mMayoria de logs del sistema (/var/log/):\e[0m"
  95.     ls -hl /var/log/   
  96. }
  97.  
  98. function hardware(){
  99.     echo ---------------------
  100.     echo -e "\e[1;31mListado de dispositivos PCI / PCIe:\e[0m"
  101.     lspci
  102.     echo ---------------------
  103.     echo -e "\e[1;31mListado de los dispositivos USB:\e[0m"
  104.     lsusb
  105. }
  106.  
  107. function alma(){ #alamacenamiento
  108.     echo ---------------------
  109.     echo -e "\e[1;31mTabla de particiones:\e[0m"
  110.     fdisk -l
  111.     echo ---------------------
  112.     echo -e "\e[1;31mEspacio usado y disponible:\e[0m"
  113.     df -h
  114.     echo ---------------------
  115.     echo -e "\e[1;31mParticon y tamaño de SWAP:\e[0m"
  116.     swapon -s
  117.     echo ---------------------
  118.     echo -e "\e[1;31mUUID (Universally Unique IDentifier) de las particiones:\e[0m"
  119.     blkid
  120. }
  121.  
  122. function redes(){
  123.     echo ---------------------
  124.     echo -e "\e[1;31mDispositivos de red alámbricos PCI:\e[0m"
  125.     lspci | grep -i ethernet
  126.     echo ---------------------
  127.     echo -e "\e[1;31mDispositivos de red inalámbricos PCI:\e[0m"
  128.     lspci | grep -i network
  129.     echo ---------------------
  130.     echo -e "\e[1;31mDispositivos de red USB:\e[0m"
  131.     lsusb | grep -i ethernet ; lsusb | grep -i network
  132.     echo ---------------------
  133.     echo -e "\e[1;31mConfiguración de las tarjetas de red y sus direcciones IP asignadas:\e[0m"
  134.     cat /etc/network/interfaces
  135.     echo ---------------------
  136.     echo -e "\e[1;31mContenido del archivo HOSTS:\e[0m"
  137.     cat /etc/hosts
  138.     echo ---------------------
  139.     echo -e "\e[1;31mNombre del equipo en la red local:\e[0m"
  140.     cat /etc/hostname
  141.     echo ---------------------
  142.     echo -e "\e[1;31mTabla de enrutamiento:\e[0m"
  143.     route -n
  144.     echo ---------------------
  145.     echo -e "\e[1;31mConfiguración de interfaces de red:\e[0m"
  146.     ifconfig
  147. }
  148.  
  149. function video(){
  150.     echo ---------------------
  151.     echo -e "\e[1;31mTarjetas de vídeo (PCI / PCIe):\e[0m"
  152.     lspci | grep -i vga
  153.     echo ---------------------
  154.     echo -e "\e[1;31mResolución actual (anchura x altura):\e[0m"
  155.     xrandr | grep '*'
  156. }
  157.  
  158. function audio(){
  159.     echo ---------------------
  160.     echo -e "\e[1;31mHardware de audio:\e[0m"
  161.     lspci | grep -i audio
  162.     echo ---------------------
  163.     echo -e "\e[1;31mDispositivos de reproducción de audio:\e[0m"
  164.     aplay -l | grep -i tarjeta
  165.     aplay -l | grep -i card
  166. }
  167.  
  168. function todo(){
  169.     fabricante
  170.     procesador
  171.     ram
  172.     kernel
  173.     shell
  174.     distro
  175.     usuario
  176.     logs
  177.     hardware
  178.     alma
  179.     redes
  180.     echo -e "\e[1;31mContenido de sources.list:\e[0m"
  181.     cat /etc/apt/sources.list
  182.     video
  183.     audio
  184. }
  185.  
  186. function menu(){
  187. clear
  188. printf "   
  189.      \e[1;31m__________________
  190.     ( System data v1.0 )
  191.      ------------------ Beta.\e[0m
  192.  
  193.     \e[1;36mBy xBalBan - wwww.xbalban.zz.mu
  194.     -------------------------------------
  195.     Reportes / Aportes: xbalban@hotmail.com
  196.                 www.fb.com/CyberpunkLinux\e[0m
  197.  
  198.     \e[0;36m[1]  Fabricante / modelo.       [9]  Hardware.
  199.     [2]  Procesador.            [10] Almacenamiento.
  200.     [3]  RAM / SWAP.            [11] Redes.
  201.     [4]  Kernel.                [12] Repositorios.
  202.     [5]  Shell.             [13] Video.
  203.     [6]  Distribución.         [14] Audio.
  204.     [7]  Entorno del usuario.       [15] Todo.
  205.     [8]  Registros (logs).          [16] Generar archivo.
  206.                         \e[0;31m[q]Salir.\e[0m
  207. "
  208. printf "    \e[0;36mQue opcion elije? :\e[0m "
  209. read opc
  210.  
  211. case $opc in
  212.     1)
  213.     clear
  214.     fabricante
  215.     ;;
  216.     2)
  217.     clear
  218.     procesador
  219.     ;;
  220.     3)
  221.     clear
  222.     ram
  223.     ;;
  224.     4)
  225.     clear
  226.     kernel
  227.     ;;
  228.     5)
  229.     clear
  230.     shell
  231.     ;;
  232.     6)
  233.     clear
  234.     distro
  235.     ;;
  236.     7)
  237.     clear
  238.     usuario
  239.     ;;
  240.     8)
  241.     clear
  242.     logs
  243.     ;;
  244.     9)
  245.     clear
  246.     hardware   
  247.     ;;
  248.     10)
  249.     clear
  250.     alma
  251.     ;;
  252.     11)
  253.     clear
  254.     redes
  255.     ;;
  256.     12)
  257.     clear
  258.     echo -e "\e[1;31mContenido de sources.list:\e[0m"
  259.     cat /etc/apt/sources.list
  260.     ;;
  261.     13)
  262.     video
  263.     ;;
  264.     14)
  265.     audio
  266.     ;;
  267.     15)
  268.     clear
  269.     todo
  270.     ;;
  271.     16)
  272.     todo | grep \e[1;31m |tee datos.data
  273.     ;;
  274.     q|Q)
  275.     clear
  276.     exit
  277.     ;;
  278.     *)
  279.     clear
  280.     echo
  281.     echo -e "\e[1;31m       [Opción no correcta]"
  282.     echo -e "       [Enter para el menu]\e[0m"
  283.     ;;
  284. esac
  285. }
  286.  
  287. while [ 1 = 1 ]
  288. do
  289. menu
  290. read
  291. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement