diff --git a/modules/security/malware-scanner.sh b/modules/security/malware-scanner.sh index e60d69f..47bad9e 100755 --- a/modules/security/malware-scanner.sh +++ b/modules/security/malware-scanner.sh @@ -657,15 +657,22 @@ for scanner in "${AVAILABLE_SCANNERS[@]}"; do log_message "ImunifyAV: Updating signatures" imunify-antivirus update &>> "$LOG_DIR/imunify.log" + log_message "ImunifyAV: Starting on-demand scan (synchronous)" + + # Use on-demand start (synchronous) instead of queue (asynchronous) for path in "${SCAN_PATHS[@]}"; do if [ -d "$path" ]; then - log_message "ImunifyAV: Queuing $path" - imunify-antivirus malware on-demand queue put "$path" &>> "$LOG_DIR/imunify.log" + log_message "ImunifyAV: Scanning $path" + echo " → Scanning: $path" + imunify-antivirus malware on-demand start --path="$path" &>> "$LOG_DIR/imunify.log" fi done - echo "✓ ImunifyAV scans queued" | tee -a "$SUMMARY_FILE" - log_message "ImunifyAV: Scans queued successfully" + # Extract malicious file count + IMUNIFY_INFECTED=$(imunify-antivirus malware malicious list 2>/dev/null | grep -c "malicious" || echo 0) + + echo "✓ ImunifyAV scan complete - Found: $IMUNIFY_INFECTED" | tee -a "$SUMMARY_FILE" + log_message "ImunifyAV: Scan complete - $IMUNIFY_INFECTED malicious files" ;; clamav)