modif du jour
This commit is contained in:
parent
76ac71caa0
commit
9a463c80c7
50
grabber.sh
50
grabber.sh
@ -1,27 +1,41 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
DIR=/opt/grabber
|
DIR=/opt/grabber
|
||||||
|
SUCCESS_LOG=/var/log/grabber/grabber-success.log
|
||||||
|
ERROR_LOG=/var/log/grabber/grabber-error.log
|
||||||
|
|
||||||
echo "======================" |tee -a /dev/stderr
|
# Affichage du texte de démarrage
|
||||||
echo " Script Grabber " |tee -a /dev/stderr
|
tee $SUCCESS_LOG $ERROR_LOG <<EOF1
|
||||||
echo "=================="|tee -a /dev/stderr
|
+++++++++++++++++++++++++++++++++
|
||||||
|
Démarrage du script Grabber
|
||||||
|
+++++++++++++++++++++++++++++++
|
||||||
|
==============================
|
||||||
|
Récupération des informations sur les paquets
|
||||||
|
==============================
|
||||||
|
EOF1
|
||||||
|
|
||||||
echo "--------------" |tee -a /dev/stderr
|
# Fichier /etc/apt/sources.list
|
||||||
echo "les périphériques USB" |tee -a /dev/stderr
|
tee -a $SUCCESS_LOG $ERROR_LOG <<EOF2
|
||||||
echo "---------------------" |tee -a /dev/stderr
|
-----------------------------------
|
||||||
echo "résultat commande lsusb :" |tee -a /dev/stderr
|
|
||||||
lsusb 1>$DIR/lsusb.cmd
|
|
||||||
|
|
||||||
echo "------------------"
|
Copie du fichier de configuration /etc/apt/sources.list
|
||||||
echo "le processeur"
|
|
||||||
echo "---------------------"
|
|
||||||
echo "résultat commande lscpu :"
|
|
||||||
lscpu 1>$DIR/lscpu.cmd
|
|
||||||
|
|
||||||
echo "--------------"
|
----------------------------------
|
||||||
echo "la RAM"
|
EOF2
|
||||||
echo "--------------"
|
|
||||||
echo "résultat commande lsmem"
|
cat /etc/apt/sources.list 2> >(tee -a $ERROR_LOG) >$DIR/sources-list.file
|
||||||
lsmem 1>$DIR/lsmem.cmd
|
|
||||||
|
# Commande apt list --installed
|
||||||
|
tee -a $SUCCESS_LOG $ERROR_LOG <<EOF3
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
Récupération de la liste des paquets installés
|
||||||
|
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
EOF3
|
||||||
|
apt list --installed 2> >(tee -a $ERROR_LOG) > apt-installed.cmd \
|
||||||
|
&& echo "[OK]: Fichier apt-installed.cmd généré" |tee -a $SUCCESS_LOG \
|
||||||
|
|| echo "[ECHEC]: Erreur à la génération de apt-installed.cmd" |tee -a $ERROR_LOG
|
||||||
|
|
||||||
|
|
||||||
#cat /etc/passwd > $DIR/passwd.file
|
#cat /etc/passwd > $DIR/passwd.file
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user