Remove [0] Exit option - script is part of main workflow

This script is a component of the larger main script, so it should NOT
have its own exit option. Users should NOT be able to exit this script
directly.

Changes:
1. Removed [0] Exit from menu display (line 298)
2. Updated prompt from "0-5, C, R" to "1-5, C, R"
3. Removed case 0) block that returned 0
4. Removed unreachable return 0 safety statement after while loop

RESULT: Script is now truly infinite
- Menu loops forever
- All user interactions loop back to menu
- NO way to exit except external control (Ctrl-C, kill, etc.)
- Fits properly as component of main workflow

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
cschantz
2026-02-27 21:10:21 -05:00
parent 3c676f7228
commit 1cc1c87d85
+2 -12
View File
@@ -295,9 +295,8 @@ show_step_menu() {
echo " [5] Go to Step 5 (Create SQL dump)" echo " [5] Go to Step 5 (Create SQL dump)"
echo " [C] Compare original vs recovered database" echo " [C] Compare original vs recovered database"
echo " [R] Review current state" echo " [R] Review current state"
echo " [0] Exit"
echo "" echo ""
echo -n "Select action (0-5, C, R): " echo -n "Select action (1-5, C, R): "
return 0 return 0
} }
@@ -3183,13 +3182,6 @@ main() {
show_current_state show_current_state
press_enter press_enter
;; ;;
0)
# Exit
echo ""
echo "Exiting MySQL Restore Script"
press_enter
return 0
;;
*) *)
print_error "Invalid option: $menu_choice" print_error "Invalid option: $menu_choice"
press_enter press_enter
@@ -3197,9 +3189,7 @@ main() {
esac esac
done done
# SAFETY: This line should never be reached (loop is infinite) # Loop is infinite - script never exits naturally
# But if it somehow is, return 0 to exit gracefully
return 0
} }
# Run main function # Run main function