diff --git a/launcher.sh b/launcher.sh index 883b73c..81b3296 100755 --- a/launcher.sh +++ b/launcher.sh @@ -56,7 +56,9 @@ run_module() { echo "" echo -e "✗ Module not found: $category/$module" echo "" - read -p "Press Enter to continue..." + if ! read -p "Press Enter to continue..." /dev/null; then + true # Continue even if read fails + fi return 1 fi @@ -77,7 +79,9 @@ run_module() { echo -e "✗ Exited with code: $exit_code" fi echo "" - read -p "Press Enter to continue..." + if ! read -p "Press Enter to continue..." /dev/null; then + true # Continue even if read fails + fi } ############################################################################# @@ -196,7 +200,9 @@ show_threat_analysis_menu() { handle_threat_analysis_menu() { while true; do show_threat_analysis_menu - read -r choice + if ! read -r choice /dev/null; then + return 0 # Exit if read fails + fi case "$choice" in 1) run_module "security" "bot-analyzer.sh" ;; @@ -230,7 +236,9 @@ show_live_monitoring_menu() { handle_live_monitoring_menu() { while true; do show_live_monitoring_menu - read -r choice + if ! read -r choice /dev/null; then + return 0 # Exit if read fails + fi case "$choice" in 1) run_module "security" "live-attack-monitor.sh" ;; @@ -262,7 +270,9 @@ show_log_viewers_menu() { handle_log_viewers_menu() { while true; do show_log_viewers_menu - read -r choice + if ! read -r choice /dev/null; then + return 0 # Exit if read fails + fi case "$choice" in 1) run_module "security" "tail-apache-access.sh" ;; @@ -293,7 +303,9 @@ show_security_actions_menu() { handle_security_actions_menu() { while true; do show_security_actions_menu - read -r choice + if ! read -r choice /dev/null; then + return 0 # Exit if read fails + fi case "$choice" in 1) run_module "security" "enable-cphulk.sh" ;; @@ -327,7 +339,9 @@ show_security_menu() { handle_security_menu() { while true; do show_security_menu - read -r choice + if ! read -r choice /dev/null; then + return 0 # Exit if read fails + fi case "$choice" in 1) handle_threat_analysis_menu ;; @@ -375,7 +389,9 @@ show_website_menu() { handle_website_menu() { while true; do show_website_menu - read -r choice + if ! read -r choice /dev/null; then + return 0 # Exit if read fails + fi case "$choice" in 1) run_module "website" "website-error-analyzer.sh" ;; @@ -428,7 +444,9 @@ show_performance_menu() { handle_performance_menu() { while true; do show_performance_menu - read -r choice + if ! read -r choice /dev/null; then + return 0 # Exit if read fails + fi case "$choice" in 1) run_module "performance" "mysql-query-analyzer.sh" ;; @@ -534,7 +552,9 @@ show_acronis_menu() { handle_backup_menu() { while true; do show_backup_menu - read -r choice + if ! read -r choice /dev/null; then + return 0 # Exit if read fails + fi case "$choice" in 1) handle_acronis_menu ;; @@ -549,7 +569,9 @@ handle_backup_menu() { handle_acronis_menu() { while true; do show_acronis_menu - read -r choice + if ! read -r choice /dev/null; then + return 0 # Exit if read fails + fi case "$choice" in 1) run_module "backup" "acronis-install.sh" ;; @@ -603,7 +625,9 @@ show_email_menu() { handle_email_menu() { while true; do show_email_menu - read -r choice + if ! read -r choice /dev/null; then + return 0 # Exit if read fails + fi case "$choice" in 1) run_module "email" "email-diagnostics.sh" ;; @@ -696,7 +720,7 @@ main() { } # Detect system configuration (builds database if cache expired) - startup_detection + startup_detection || true while true; do show_main_menu