diff --git a/modules/backup/mysql-restore-to-sql.sh b/modules/backup/mysql-restore-to-sql.sh index b692158..1555434 100755 --- a/modules/backup/mysql-restore-to-sql.sh +++ b/modules/backup/mysql-restore-to-sql.sh @@ -2950,9 +2950,17 @@ main() { local menu_choice="" while true; do + # Infinite loop - only exits with explicit "return 0" on option [0] show_step_menu read -r menu_choice + # Ensure menu_choice is not empty (handle EOF/Ctrl-D) + if [ -z "$menu_choice" ]; then + print_error "Invalid option (empty input). Returning to menu." + press_enter + continue + fi + case $menu_choice in 1) # Step 1: Detect live data directory @@ -3138,6 +3146,10 @@ 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 } # Run main function