Created
July 11, 2018 01:36
-
-
Save normeno/8635484dd4f77002a18b32a1cf8bc1fa to your computer and use it in GitHub Desktop.
Script para ver información del sistema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Author: Nicolás Ormeño Rojas | |
# | |
#Date: 2010 | |
# | |
clear | |
echo "Para poder ejecutar todas las acciones" | |
echo "Su equipo debe contar con:" | |
echo "dmidecode, nmap, samba" | |
echo "" | |
if [ `whoami` != root ]; then | |
echo "debe ejecutar el script como root" | |
else | |
REPETIR=s | |
while [ "$REPETIR" = s ] | |
do | |
clear | |
echo "Debe elegir una operación a realizar" | |
echo "1) Listar información de BIOS" | |
echo "2) Listar información de Motherdoard" | |
echo "3) Listar información de procesador" | |
echo "4) Listar información de memoria RAM" | |
echo "5) Listar información de memoria SWAP" | |
echo "6) Listar información de hw de video" | |
echo "7) Listar información de hw de audio" | |
echo "8) Listar información de hw ethernet" | |
echo "9) Listar información de hw netwotk" | |
echo "10) Mostrar uptime del sistema" | |
echo "11) Mostrar IP Adress y MAC Adrress" | |
echo "" | |
read -p "¿Qué operación realizar? " op | |
case $op in | |
1)echo "" | |
echo "`dmidecode |grep -A 21 'BIOS Information'`" | |
;; | |
2)echo "" | |
echo "`dmidecode |grep -A 10 'Base Board Information'`" | |
;; | |
3)echo "" | |
echo "`cat /proc/cpuinfo | grep name | awk '{ print $0 }' | awk -F: '{ print $2 }'`" | |
echo "`dmidecode |grep -A 53 'Processor Information'` |more" | |
;; | |
4)echo "" | |
echo "Total: " `free -h | grep -A 1 'total' | awk -F: '{ print $2 }' | awk '{ print $1 }'` | |
echo "Usada: " `free -h | grep -A 1 'used' | awk -F: '{ print $2 }' | awk '{ print $2 }'` | |
echo "Libre: " `free -h | grep -A 1 'free' | awk -F: '{ print $2 }' | awk '{ print $3 }'` | |
;; | |
5)echo "" | |
echo "Total: " `free -h | grep 'Swap' |awk '{ print $2 }'` | |
echo "Usada: " `free -h | grep 'Swap' |awk '{ print $3 }'` | |
echo "Libre: " `free -h | grep 'Swap' |awk '{ print $4 }'` | |
;; | |
6)echo "" | |
;; | |
7)echo "" | |
echo "`lspci |grep -A 9 'Audio'`" | |
;; | |
8)echo "" | |
echo "`lspci |grep -A 10 'Ethernet controller'`" | |
;; | |
9)echo"" | |
echo "`lspci |grep -A 12 'Network controller'`" | |
;; | |
10)echo "" | |
echo "`uptime | awk '{ print $3 $4 }'`" | |
;; | |
11)echo "" | |
echo "eth0 IP : "`ifconfig eth0 | grep inet | awk '{ print $2 }' | awk -F: '{ print $2 }'` | |
echo "eth0 Mac : "`ifconfig eth0 | grep HWaddr | awk '{ print $5 }'` | |
echo "wlan0 IP : "`ifconfig wlan0 | grep inet | awk '{ print $2 }' | awk -F: '{ print $2 }'` | |
echo "wlan0 MAC : "`ifconfig wlan0 | grep HWaddr | awk '{ print $5 }'` | |
;; | |
12)echo "" | |
echo `users` | |
;; | |
*) | |
echo "Error al elegir la operación a realizar" | |
;; | |
esac | |
echo "" | |
read -p "¿Realizar otra operación? (s/N) " REPETIR | |
done | |
clear | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment