From a138e09bd6926f5cf0111834f8e0215a6f9b744e Mon Sep 17 00:00:00 2001 From: tenzi Date: Sun, 28 Dec 2025 15:12:02 +0100 Subject: [PATCH] petits modifs --- grabber.sh | 69 ++++++++++++++++++++++-------------------------------- 1 file changed, 28 insertions(+), 41 deletions(-) diff --git a/grabber.sh b/grabber.sh index 22e36e1..a6a3c03 100755 --- a/grabber.sh +++ b/grabber.sh @@ -6,71 +6,59 @@ SUM="$DIR/summary.txt" # Affichage du texte de démarrage tee $SUCCESS_LOG $ERROR_LOG < >(tee -a $ERROR_LOG) >$DIR/sources-list.file +cat /etc/apt/sources.list 2> >(tee -a $ERROR_LOG) >$DIR/sources-list.file \ + && echo "[OK]: Fichier sources-list.file généré" |tee -a $SUCCESS_LOG \ + || echo "[ECHEC]: Erreur à la génération de sources-list.file" |tee -a $ERROR_LOG # 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/$1 -} +#treat_file() { +# echo "Les arguments: $@" +# cat $2 |grep -v '^#' | grep -v '^$' >>$DIR/$1 +#} -treat_cmd() { - +#treat_file sources_list.file /etc/apt/sources.list +#for file in ${!FILES[@]}; do +# treat_file $file ${FILES[$file]} +#done -treat_file sources_list.file /etc/apt/sources.list - -for file in ${!FILES[@]}; do - treat_file $file ${FILES[$file]} -done #cat /etc/ssh/ssh_config > $DIR/ssh_config.file #cat /etc/passwd > $DIR/passwd.file #cat /etc/group > $DIR/group.file @@ -92,7 +80,8 @@ for disk in ${DEVICES[@]}; do disk_parts=$(lsblk -nr -o PKNAME,PATH $disk_path |grep -vE "^ " |cut -d \ -f2) PARTITIONS_BY_DISK[$disk]=${disk_parts[@]} done - +echo " " +echo "INFOS ORDINATEUR" echo "Combien de disques sur l'ordinateur ? ${#DEVICES[@]}" echo "keys: ${!PARTITIONS_BY_DISK[@]}" echo "values: ${PARTITIONS_BY_DISK[@]}" @@ -124,7 +113,6 @@ done hardware software() { - echo " " >>$SUM echo "[SOFTWARE]" >>$SUM echo "OS=$(lsb_release -a |grep Description |cut -f2)" >>$SUM echo "ARCH=$(uname -m)" >>$SUM @@ -134,4 +122,3 @@ software() { } software -