y'en a marre
This commit is contained in:
parent
9af0f457b5
commit
d7d7545bac
@ -1,114 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
######### Script d'etablissement de la fiche technique d'un PC #########
|
||||
|
||||
FILE="$DESKTOP/identification.txt"
|
||||
|
||||
usage()
|
||||
{ echo ' Usage:'
|
||||
echo ' -Argument 1: Entrer: p pour portable ou d pour desktop'
|
||||
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 Desktop)
|
||||
if [ "${1}" = "p" ]
|
||||
then echo '#*******************************************************#'
|
||||
echo "# Portable numéro de série: ${2} "
|
||||
echo '#*******************************************************#'
|
||||
elif [ "${1}" = "d" ]
|
||||
then echo '#*******************************************************#'
|
||||
echo "# Desktop numéro de série: ${2} "
|
||||
echo '#*******************************************************#'
|
||||
fi
|
||||
|
||||
#*********** Identification PC *************
|
||||
echo '' > $FILE
|
||||
echo '/************** Identification PC **************/' >> $FILE
|
||||
/usr/sbin/lshw -class system | sed -n '/description/p;/produit/p;/fabriquant/p;/numéro/p' >> $FILE
|
||||
|
||||
#*********** Identification BIOS *************
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification BIOS **********' >> $FILE
|
||||
/usr/sbin/dmidecode -t bios | sed -n '/Vendor/p;/Version/p;/Release/p;/Revision/p' >> $FILE
|
||||
|
||||
#*********** Identification CARTE MERE *************
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification CARTE MERE **********' >> $FILE
|
||||
/usr/sbin/lshw | grep -A 5 "description: Carte mère" >> $FILE
|
||||
|
||||
#*********** Identification CARTE GRAPHIQUE *************
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification CARTE GRAPHIQUE **********' >> $FILE
|
||||
/usr/sbin/lshw -class display | sed -n '/description/p;/produit/p;/fabriquant/p;/version/p' >> $FILE
|
||||
|
||||
#*********** Identification processeur *************
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification processeur **********' >> $FILE
|
||||
/usr/sbin/lshw -class processor | sed -n '/description/p;/produit/p;/fabriquant/p;/bits/p;/configuration/p' >> $FILE
|
||||
|
||||
#*********** Identification RAM *************
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification RAM **********' >> $FILE
|
||||
/usr/sbin/dmidecode -t memory | head -n 24 | sed -n '/Maximum/p' >> $FILE
|
||||
echo '' >> $FILE
|
||||
/usr/sbin/dmidecode -t memory | head -n 24 | sed -n '/Bank/p' >> $FILE
|
||||
/usr/sbin/dmidecode -t memory | head -n 30 | sed -n '/Manufacturer/p;/Type/p;/Size/p;/Speed/p;/Serial/p' >> $FILE
|
||||
echo '' >> $FILE
|
||||
/usr/sbin/dmidecode -t memory | tail -n 11 | sed -n '/Bank/p' >> $FILE
|
||||
/usr/sbin/dmidecode -t memory | tail -n 19 | sed -n '/Manufacturer/p;/Type/p;/Size/p;/Speed/p;/Serial/p' >> $FILE
|
||||
|
||||
#*********** Identification HDD *************
|
||||
#echo '' >> $FILE
|
||||
#echo ' /********** Identification HDD **********' >> $FILE
|
||||
#/usr/sbin/lshw -class disk | head -n 13 | sed -n '/description/p;/produit/p;/fabriquant/p;/série/p;/taille/p' >> $FILE
|
||||
|
||||
#*********** Identification DVD *************
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification DVD **********' >> $FILE
|
||||
/usr/sbin/lshw -class disk | tail -n 14 | sed -n '/description/p;/produit/p;/fabriquant/p;/version:/p;/fonctionnalités:/p' >> $FILE
|
||||
|
||||
#*********** Identification réseau filaire *************
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification réseau filaire **********' >> $FILE
|
||||
/usr/sbin/lshw -class network | head -n 13 | sed -n '/description/p;/produit/p;/fabriquant/p;/numéro/p;/capacité/p' >> $FILE
|
||||
|
||||
#*********** Identification autre réseau *************
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification autre réseau **********' >> $FILE
|
||||
/usr/sbin/lshw -class network | tail -n 14 | sed -n '/description/p;/produit/p;/fabriquant/p;/numéro/p' >> $FILE
|
||||
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification USB et autre**********' >> $FILE
|
||||
lsusb >> $FILE
|
||||
|
||||
#*********** Identification batterie *************
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification Batterie **********' >> $FILE
|
||||
/usr/sbin/lshw -class power | sed -n '/produit/p;/fabriquant/p;/capacité/p;/configuration/p' >> $FILE
|
||||
echo '' >> $FILE
|
||||
|
||||
#*********** Test des disques durs *************
|
||||
for DISK in `lsblk -dn -x NAME --output NAME`
|
||||
do
|
||||
echo '' >> $FILE
|
||||
echo " /********** Test du disk #$DISK# **********" >> $FILE
|
||||
/usr/sbin/smartctl -H /dev/$DISK| grep -c "PASSED"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
/usr/sbin/smartctl -a /dev/$DISK >> $FILE
|
||||
echo "############ Problème sur le disque $DISK ########################"
|
||||
echo "############ Problème sur le disque $DISK ########################" >>$FILE
|
||||
|
||||
echo '' >> $FILE
|
||||
else
|
||||
/usr/sbin/smartctl -i /dev/$DISK >> $FILE
|
||||
echo "############ Pas de problèmes détectés sur le disque $DISK ########################"
|
||||
echo "############ Pas de problèmes détectés sur le disque $DISK ########################" >> $FILE
|
||||
fi
|
||||
done
|
||||
|
@ -1,23 +0,0 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
DESKTOP=`grep XDG_DESKTOP_DIR $1/.config/user-dirs.dirs`
|
||||
DESKTOP=${DESKTOP##*}
|
||||
export $DESKTOP
|
||||
|
||||
/usr/local/bin/identPC.sh
|
||||
/usr/bin/kate $DESKTOP/checklist.txt
|
||||
grep -is -m 2 "numéro de série" $DESKTOP/identification.txt >tmp.txt
|
||||
while read LIGNE
|
||||
do
|
||||
TMP=${LIGNE##*}
|
||||
if [ "$TMP" != "Number" ];then
|
||||
DIRNAME="$DIRNAME$TMP"
|
||||
break
|
||||
else
|
||||
DIRNAME="CM_"
|
||||
fi
|
||||
|
||||
done < tmp.txt
|
||||
rm -f tmp.txt
|
||||
mkdir $DIRNAME
|
||||
rsync --port 10073 -aP $DESKTOP/*.txt "lalis69.ddns.net::lalis-ordis/$DIRNAME"
|
Reference in New Issue
Block a user