#!/bin/bash DIR=/opt/grabber SUCCESS_LOG=/var/log/grabber/grabber-success.log ERROR_LOG=/var/log/grabber/grabber-error.log # Affichage du texte de démarrage tee $SUCCESS_LOG $ERROR_LOG < >(tee -a $ERROR_LOG) >$DIR/sources-list.file # Commande apt list --installed tee -a $SUCCESS_LOG $ERROR_LOG < >(tee -a $ERROR_LOG) >$DIR/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 # Commande array tee -a $SUCCESS_LOG $ERROR_LOG <$DIR/status.log for disk in ${!PARTITIONS_BY_DISK[@]}; do echo "PARTS_$disk=$(printf '%s ' ${PARTITIONS_BY_DISK[$disk]})" >>$DIR/status.log done treat_file() { echo "Les arguments: $@" echo "Argument 1: $1" cat $2 >>$DIR/$1 } treat_file sources_list.file /etc/apt/sources.list for file in ${!FILES[@]}; do treat_file $file ${FILES[$file]} done #cat /etc/passwd > $DIR/passwd.file #cat /etc/group > $DIR/group.file #lspci -nn > $DIR/lspci.cmd #lsusb > $DIR/lsusb.cmd #apt list --installed > $DIR/apt.cmd #systemd-analyze > $DIR/systemd-analyze.cmd #systemd-analyze blame | head -n 10 > $DIR/systemd-blame.cmd #lscpu > $DIR/lscpu.cmd #lshw-gtk > $DIR/lshw-gtk.cmd #inxi > $DIR/inxi.cmd #lsmem > $DIR/lsmem.cmd