Boucle de test : déplacement création variable MODEL

La variable MODEL n'était plus alimentée pour les disques dont le test était terminé.
This commit is contained in:
John Doe 2021-05-12 23:08:41 +02:00
parent 4e773962ff
commit 9090c626fd
1 changed files with 1 additions and 1 deletions

View File

@ -55,11 +55,11 @@ do
FIN_TEST="OK"
for i in "${DISKS[@]}"
do
MODEL=($(/usr/sbin/smartctl -i $i | grep "Device Model:" | sed "s/Device Model: //g"))
if /usr/sbin/smartctl -c "$i" | grep "Self-test routine in progress" > /dev/null 2>&1; then #Si scan non fini
FIN_TEST="NOK" #On repasse la variable FIN_TEST a FALSE
TEMPS=($(date +"%T"))
POURCENTAGE_RESTANT=($(/usr/sbin/smartctl -c "$i" | grep "% of test remaining"))
MODEL=($(/usr/sbin/smartctl -i $i | grep "Device Model:" | sed "s/Device Model: //g"))
echo "$TEMPS : $POURCENTAGE_RESTANT du selftest restant sur le disque ${MODEL[@]} ($i)."
else
echo "$TEMPS : selftest terminé sur le disque ${MODEL[@]} ($i)."