94 lines
3.4 KiB
Bash
94 lines
3.4 KiB
Bash
|
#!/bin/bash
|
||
|
######### Script d'etablissement de la fiche technique d'un PC #########
|
||
|
usage()
|
||
|
{ echo ' Usage:'
|
||
|
echo ' -Argument 1: Entrer: p pour portable ou d pour destop'
|
||
|
echo ' -Argument 2: Entrer: le numéro de série du PC'
|
||
|
echo ''
|
||
|
}
|
||
|
|
||
|
# test du nombre d'arguments < 2
|
||
|
if [ "${#}" -lt 2 ]
|
||
|
then usage
|
||
|
exit 3
|
||
|
fi
|
||
|
# test du type de PC (Portable ou Destop)
|
||
|
if [ "${1}" = "p" ]
|
||
|
then echo '#*******************************************************#'
|
||
|
echo "# Portable numéro de série: ${2} "
|
||
|
echo '#*******************************************************#'
|
||
|
elif [ "${1}" = "d" ]
|
||
|
then echo '#*******************************************************#'
|
||
|
echo "# Destop numéro de série: ${2} "
|
||
|
echo '#*******************************************************#'
|
||
|
else usage exit
|
||
|
fi
|
||
|
|
||
|
#*********** Identification PC *************
|
||
|
echo ''
|
||
|
echo '/************** Identification PC **************/'
|
||
|
lshw -class system | sed -n '/description/p;/produit/p;/fabriquant/p;/numéro/p'
|
||
|
|
||
|
#*********** Identification BIOS *************
|
||
|
echo ''
|
||
|
echo ' /********** Identification BIOS **********'
|
||
|
dmidecode -t bios | sed -n '/Vendor/p;/Version/p;/Release/p;/Revision/p'
|
||
|
|
||
|
#*********** Identification CARTE MERE *************
|
||
|
echo ''
|
||
|
echo ' /********** Identification CARTE MERE **********'
|
||
|
dmidecode -t baseboard | sed -n '/Manufacturer/p;/Product/p;/Serial/p'
|
||
|
|
||
|
#*********** Identification CARTE GRAPHIQUE *************
|
||
|
echo ''
|
||
|
echo ' /********** Identification CARTE GRAPHIQUE **********'
|
||
|
lshw -class display | sed -n '/description/p;/produit/p;/fabriquant/p;/version/p'
|
||
|
|
||
|
#*********** Identification processeur *************
|
||
|
echo ''
|
||
|
echo ' /********** Identification processeur **********'
|
||
|
lshw -class processor | sed -n '/description/p;/produit/p;/fabriquant/p;/bits/p;/configuration/p'
|
||
|
|
||
|
#*********** Identification RAM *************
|
||
|
echo ''
|
||
|
echo ' /********** Identification RAM **********'
|
||
|
dmidecode -t memory | head -n 24 | sed -n '/Maximum/p'
|
||
|
echo ''
|
||
|
dmidecode -t memory | head -n 24 | sed -n '/Bank/p'
|
||
|
dmidecode -t memory | head -n 30 | sed -n '/Manufacturer/p;/Type/p;/Size/p;/Speed/p;/Serial/p'
|
||
|
echo ''
|
||
|
dmidecode -t memory | tail -n 11 | sed -n '/Bank/p'
|
||
|
dmidecode -t memory | tail -n 19 | sed -n '/Manufacturer/p;/Type/p;/Size/p;/Speed/p;/Serial/p'
|
||
|
|
||
|
#*********** Identification HDD *************
|
||
|
echo ''
|
||
|
echo ' /********** Identification HDD **********'
|
||
|
lshw -class disk | head -n 13 | sed -n '/description/p;/produit/p;/fabriquant/p;/série/p;/taille/p'
|
||
|
|
||
|
#*********** Identification DVD *************
|
||
|
echo ''
|
||
|
echo ' /********** Identification DVD **********'
|
||
|
lshw -class disk | tail -n 14 | sed -n '/description/p;/produit/p;/fabriquant/p;/version:/p;/fonctionnalités:/p'
|
||
|
|
||
|
#*********** Identification réseau filaire *************
|
||
|
echo ''
|
||
|
echo ' /********** Identification réseau filaire **********'
|
||
|
lshw -class network | head -n 13 | sed -n '/description/p;/produit/p;/fabriquant/p;/numéro/p;/capacité/p'
|
||
|
|
||
|
#*********** Identification autre réseau *************
|
||
|
echo ''
|
||
|
echo ' /********** Identification autre réseau **********'
|
||
|
lshw -class network | tail -n 14 | sed -n '/description/p;/produit/p;/fabriquant/p;/numéro/p'
|
||
|
|
||
|
echo ''
|
||
|
echo ' /********** Identification USB et autre**********'
|
||
|
lsusb
|
||
|
|
||
|
#*********** Identification baterie *************
|
||
|
echo ''
|
||
|
echo ' /********** Identification Batterie **********'
|
||
|
lshw -class power | sed -n '/produit/p;/fabriquant/p;/capacité/p;/configuration/p'
|
||
|
echo ''
|
||
|
|
||
|
|