Modification majeure de identPC et création sync_lalis.sh
This commit is contained in:
parent
9768dbb81d
commit
74a9cdcb4b
@ -1,93 +1,114 @@
|
||||
#!/bin/bash
|
||||
######### Script d'etablissement de la fiche technique d'un PC #########
|
||||
|
||||
FILE="identification.txt"
|
||||
|
||||
usage()
|
||||
{ echo ' Usage:'
|
||||
echo ' -Argument 1: Entrer: p pour portable ou d pour destop'
|
||||
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 Destop)
|
||||
#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 "# Destop numéro de série: ${2} "
|
||||
echo "# Desktop 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'
|
||||
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 ''
|
||||
echo ' /********** Identification BIOS **********'
|
||||
dmidecode -t bios | sed -n '/Vendor/p;/Version/p;/Release/p;/Revision/p'
|
||||
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 ''
|
||||
echo ' /********** Identification CARTE MERE **********'
|
||||
dmidecode -t baseboard | sed -n '/Manufacturer/p;/Product/p;/Serial/p'
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification CARTE MERE **********' >> $FILE
|
||||
/usr/sbin/dmidecode -t baseboard | sed -n '/Manufacturer/p;/Product/p;/Serial/p' >> $FILE
|
||||
|
||||
#*********** Identification CARTE GRAPHIQUE *************
|
||||
echo ''
|
||||
echo ' /********** Identification CARTE GRAPHIQUE **********'
|
||||
lshw -class display | sed -n '/description/p;/produit/p;/fabriquant/p;/version/p'
|
||||
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 ''
|
||||
echo ' /********** Identification processeur **********'
|
||||
lshw -class processor | sed -n '/description/p;/produit/p;/fabriquant/p;/bits/p;/configuration/p'
|
||||
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 ''
|
||||
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'
|
||||
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 ''
|
||||
echo ' /********** Identification HDD **********'
|
||||
lshw -class disk | head -n 13 | sed -n '/description/p;/produit/p;/fabriquant/p;/série/p;/taille/p'
|
||||
#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 ''
|
||||
echo ' /********** Identification DVD **********'
|
||||
lshw -class disk | tail -n 14 | sed -n '/description/p;/produit/p;/fabriquant/p;/version:/p;/fonctionnalités:/p'
|
||||
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 ''
|
||||
echo ' /********** Identification réseau filaire **********'
|
||||
lshw -class network | head -n 13 | sed -n '/description/p;/produit/p;/fabriquant/p;/numéro/p;/capacité/p'
|
||||
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 ''
|
||||
echo ' /********** Identification autre réseau **********'
|
||||
lshw -class network | tail -n 14 | sed -n '/description/p;/produit/p;/fabriquant/p;/numéro/p'
|
||||
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 ''
|
||||
echo ' /********** Identification USB et autre**********'
|
||||
lsusb
|
||||
echo '' >> $FILE
|
||||
echo ' /********** Identification USB et autre**********' >> $FILE
|
||||
lsusb >> $FILE
|
||||
|
||||
#*********** Identification baterie *************
|
||||
echo ''
|
||||
echo ' /********** Identification Batterie **********'
|
||||
lshw -class power | sed -n '/produit/p;/fabriquant/p;/capacité/p;/configuration/p'
|
||||
echo ''
|
||||
#*********** 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
|
||||
|
||||
|
3
SOURCES/sync_lalis.sh
Normal file
3
SOURCES/sync_lalis.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
rsync -aP *.txt 192.168.1.253::lalis-ordis
|
@ -9,6 +9,8 @@ Url: http://lalis.fr
|
||||
Source1: journald.conf
|
||||
Source2: lalistunnel
|
||||
Source3: Lalis.desktop
|
||||
Source4: identPC.sh
|
||||
Source5:
|
||||
Requires: openssh-server
|
||||
Requires: sshfs-fuse
|
||||
Requires: celestia
|
||||
@ -123,6 +125,7 @@ mkdir -p %{buildroot}/usr/share/kio_desktop/
|
||||
mkdir -p %{buildroot}/usr/share/dist/desktop-files/default/
|
||||
cp -af %{SOURCE1} %{buildroot}/tmp/
|
||||
cp -f %{SOURCE2} %{buildroot}/usr/local/bin/
|
||||
cp -f %{SOURCE4} %{buildroot}/usr/local/bin/
|
||||
cp -f %{SOURCE3} %{buildroot}/usr/share/kio_desktop/
|
||||
cp -f %{SOURCE3} %{buildroot}/usr/share/dist/desktop-files/default/
|
||||
|
||||
|
Reference in New Issue
Block a user