From 7370e9077940651d433784de25a87ce3086c98fd Mon Sep 17 00:00:00 2001 From: Developer Date: Tue, 21 Apr 2026 21:00:45 -0400 Subject: [PATCH] Fix: Maldet menu now runs ONLY Maldet, not all scanners Issue: Selecting scan from Maldet menu ran all available scanners (ImunifyAV, Maldet, RKHunter) instead of just Maldet Root cause: Variable case mismatch - code checked AVAILABLE_SCANNERS (uppercase) but actual array was available_scanners (lowercase). So MALDET_ONLY filter never worked. Solution: - Fixed variable names to lowercase throughout - MALDET_ONLY flag now properly filters to Maldet-only - Changed exit to return (for sourced function) Now Maldet menu only uses Maldet, multi-scanner mode is separate. --- modules/security/malware-scanner.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/security/malware-scanner.sh b/modules/security/malware-scanner.sh index ff69c03..db0c78a 100755 --- a/modules/security/malware-scanner.sh +++ b/modules/security/malware-scanner.sh @@ -1480,16 +1480,17 @@ fi # Filter scanners if MALDET_ONLY is set (for Maldet-specific menu) if [ "${MALDET_ONLY:-0}" = "1" ]; then log_message "Maldet-only mode enabled" - echo "🔍 Running Maldet-only scan (fastest, Linux-focused)" + echo "Running Maldet-only scan (fastest, Linux-focused)" echo "" # Check if Maldet is available - if [[ " ${AVAILABLE_SCANNERS[@]} " =~ " maldet " ]]; then - AVAILABLE_SCANNERS=("maldet") + if [[ " ${available_scanners[@]} " =~ " maldet " ]]; then + available_scanners=("maldet") log_message "Filtered to Maldet only" else log_message "ERROR: Maldet not installed but MALDET_ONLY was set" echo -e "${RED}ERROR: Maldet is not installed${NC}" - exit 1 + read -p "Press Enter to continue..." < /dev/tty 2>/dev/null || true + return 1 fi fi