From ccf2f6a1815528dd649026c0ed3abbdd080d9ef2 Mon Sep 17 00:00:00 2001 From: gilles Date: Sun, 15 Dec 2024 03:37:41 +0100 Subject: [PATCH] bug 2 --- post_inst_deb.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/post_inst_deb.sh b/post_inst_deb.sh index f6fa6a2..2894db4 100644 --- a/post_inst_deb.sh +++ b/post_inst_deb.sh @@ -181,9 +181,20 @@ show_menu() { # Boucle principale while true; do show_menu + echo -n "Choisissez une option : " read -r choice - echo "DEBUG: Vous avez saisi : $choice" # Ligne ajoutée pour debug - case $choice in + + # Vérifier si la saisie est vide + if [ -z "$choice" ]; then + echo "[ERROR] Aucune saisie détectée. Veuillez entrer un chiffre." + continue + fi + + # Debug pour voir ce qui a été saisi + echo "DEBUG: Vous avez saisi : '$choice'" + + # Gérer les choix + case "$choice" in 1) update_and_clean_system ;; 2) install_nfs_server ;; 3) install_nfs_client ;; @@ -193,6 +204,7 @@ while true; do 7) configure_network ;; 8) install_usual_tools ;; 9) echo -e "${GREEN}Au revoir !${RESET}" ; exit 0 ;; - *) error "Option invalide, veuillez réessayer." ;; + *) echo "[ERROR] Option invalide, veuillez réessayer." ;; esac done +