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:
@@ -408,13 +408,29 @@ install_all_scanners() {
|
|||||||
|
|
||||||
# Check if installation succeeded
|
# Check if installation succeeded
|
||||||
if is_maldet_installed; then
|
if is_maldet_installed; then
|
||||||
echo -e "${GREEN}✓ Maldet installed${NC}"
|
# 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"
|
rm -f "$install_log"
|
||||||
|
|
||||||
# Update malware signatures immediately with timeout
|
# Update malware signatures immediately with timeout
|
||||||
echo " → Updating malware signatures..."
|
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 [ -n "$maldet_bin" ]; then
|
||||||
if timeout 120 "$maldet_bin" -u 2>&1 | grep -qE "update completed|signatures"; then
|
if timeout 120 "$maldet_bin" -u 2>&1 | grep -qE "update completed|signatures"; then
|
||||||
echo -e " ${GREEN}✓${NC} Signatures updated"
|
echo -e " ${GREEN}✓${NC} Signatures updated"
|
||||||
|
|||||||
Reference in New Issue
Block a user