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:
@@ -295,9 +295,8 @@ show_step_menu() {
|
||||
echo " [5] Go to Step 5 (Create SQL dump)"
|
||||
echo " [C] Compare original vs recovered database"
|
||||
echo " [R] Review current state"
|
||||
echo " [0] Exit"
|
||||
echo ""
|
||||
echo -n "Select action (0-5, C, R): "
|
||||
echo -n "Select action (1-5, C, R): "
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -3183,13 +3182,6 @@ main() {
|
||||
show_current_state
|
||||
press_enter
|
||||
;;
|
||||
0)
|
||||
# Exit
|
||||
echo ""
|
||||
echo "Exiting MySQL Restore Script"
|
||||
press_enter
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
print_error "Invalid option: $menu_choice"
|
||||
press_enter
|
||||
@@ -3197,9 +3189,7 @@ main() {
|
||||
esac
|
||||
done
|
||||
|
||||
# SAFETY: This line should never be reached (loop is infinite)
|
||||
# But if it somehow is, return 0 to exit gracefully
|
||||
return 0
|
||||
# Loop is infinite - script never exits naturally
|
||||
}
|
||||
|
||||
# Run main function
|
||||
|
||||
Reference in New Issue
Block a user