afficher un pourcentage d’avancement
This commit is contained in:
@@ -202,7 +202,16 @@ echo -e "\n--- Démarrage du traitement ---\n"
|
||||
|
||||
# Parcourir la liste des machines
|
||||
|
||||
total=${#machines[@]}
|
||||
current=0
|
||||
|
||||
for machine in "${machines[@]}"; do
|
||||
|
||||
((current++))
|
||||
percent=$(( current * 100 / total ))
|
||||
bar=$(printf "%-${total}s" "#" | cut -c 1-$current)
|
||||
echo -ne "[${percent}%] [${bar}] $machine ($current/$total)\n"
|
||||
|
||||
# Vérification si le nom de machine est présent dans le fichier .config/updateall-hosts
|
||||
echo -e "\n"
|
||||
echo -n " >> $machine "
|
||||
|
||||
Reference in New Issue
Block a user