feat: add Maldet 2.0+ version verification and detection

- Checks installed Maldet version after installation
- Verifies version 2.0 or newer (10x performance improvements)
- Warns if older version detected
- Shows version info in installation output
- Ensures we're using the latest optimized version
This commit is contained in:
Developer
2026-04-02 16:49:32 -04:00
parent 629176d301
commit 2c4efbc805
+18 -2
View File
@@ -408,13 +408,29 @@ install_all_scanners() {
# Check if installation succeeded
if is_maldet_installed; then
# Verify we have version 2.0 or newer
local maldet_bin=$(command -v maldet || find /usr/local -name maldet -type f 2>/dev/null | head -1)
local maldet_version=""
if [ -n "$maldet_bin" ]; then
maldet_version=$("$maldet_bin" -v 2>/dev/null | grep -oE '[0-9]+\.[0-9]+' | head -1)
fi
# Check version is 2.0 or newer
if [ -n "$maldet_version" ]; then
local major_version=$(echo "$maldet_version" | cut -d. -f1)
if [ "$major_version" -lt 2 ]; then
echo -e "${YELLOW}⚠ Warning: Maldet version $maldet_version installed (2.0+ recommended for performance)${NC}"
else
echo -e "${GREEN}${NC} Maldet $maldet_version installed (2.0+ performance optimizations)"
fi
else
echo -e "${GREEN}✓ Maldet installed${NC}"
fi
rm -f "$install_log"
# Update malware signatures immediately with timeout
echo " → Updating malware signatures..."
# Try to find maldet binary (might not be in PATH yet)
local maldet_bin=$(command -v maldet || find /usr/local -name maldet -type f 2>/dev/null | head -1)
if [ -n "$maldet_bin" ]; then
if timeout 120 "$maldet_bin" -u 2>&1 | grep -qE "update completed|signatures"; then
echo -e " ${GREEN}${NC} Signatures updated"