updateall : ajout un récapitulatif des connexions
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Initialiser les tableaux
|
||||
ignored_machines=()
|
||||
ok_machines=()
|
||||
error_machines=()
|
||||
|
||||
# Variables pour les codes de couleur ANSI
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
@@ -162,6 +167,9 @@ echo "Clé d'installation : $uniqkey"
|
||||
# Récupérer les alias SSH
|
||||
machines=($(get_ssh_aliases))
|
||||
|
||||
|
||||
echo -e "\n--- Démarrage du traitement ---\n"
|
||||
|
||||
# Parcourir la liste des machines
|
||||
|
||||
for machine in "${machines[@]}"; do
|
||||
@@ -183,24 +191,59 @@ for machine in "${machines[@]}"; do
|
||||
if [ "$keyinstall_present" -eq 0 ]; then
|
||||
update_machine "$machine"
|
||||
create_installkey "$machine" "$uniqkey"
|
||||
ok_machines+=("$machine")
|
||||
fi
|
||||
else
|
||||
error_machines+=("$machine")
|
||||
fi
|
||||
else
|
||||
echo -e "${RED}ignorée${NC}"
|
||||
ignored_machines+=("$machine")
|
||||
fi
|
||||
else
|
||||
if [ "$machine_online" -eq 1 ]; then
|
||||
echo -e "${RED}vue pour la 1re fois${NC}"
|
||||
|
||||
check_host "$machine"
|
||||
machine_online="$?"
|
||||
|
||||
if [ "$machine_online" -eq 1 ]; then
|
||||
echo -e "${RED}vue pour la 1re fois${NC}"
|
||||
confirm_update "$machine"
|
||||
update_machine "$machine"
|
||||
run_custom_script "$machine"
|
||||
create_installkey "$machine" "$uniqkey"
|
||||
ok_machines+=("$machine")
|
||||
else
|
||||
echo -e "${RED}non accessible${NC}"
|
||||
error_machines+=("$machine")
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
done
|
||||
|
||||
echo -e "\n--- Résumé des machines ---\n"
|
||||
|
||||
# Afficher les machines ignorées
|
||||
echo -e "${RED}Machines ignorées :${NC}"
|
||||
for machine in "${ignored_machines[@]}"; do
|
||||
echo " - $machine"
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
# Afficher les machines en erreur
|
||||
echo -e "${RED}Machines en erreur :${NC}"
|
||||
for machine in "${error_machines[@]}"; do
|
||||
echo " - $machine"
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
# Afficher les machines ok
|
||||
echo -e "${GREEN}Machines mises à jour avec succès :${NC}"
|
||||
for machine in "${ok_machines[@]}"; do
|
||||
echo " - $machine"
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user