From 1cc1c87d85a357eb7d3d4c5099b04430d470df0a Mon Sep 17 00:00:00 2001 From: cschantz Date: Fri, 27 Feb 2026 21:10:21 -0500 Subject: [PATCH] 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 --- modules/backup/mysql-restore-to-sql.sh | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/modules/backup/mysql-restore-to-sql.sh b/modules/backup/mysql-restore-to-sql.sh index bc67af6..4e1effd 100755 --- a/modules/backup/mysql-restore-to-sql.sh +++ b/modules/backup/mysql-restore-to-sql.sh @@ -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