sync: Update malware-scanner with individual installer functions and fallback download sources
This commit is contained in:
@@ -222,8 +222,20 @@ install_all_scanners() {
|
|||||||
echo -e "${GREEN}✓ ClamAV already installed (cPanel)${NC}"
|
echo -e "${GREEN}✓ ClamAV already installed (cPanel)${NC}"
|
||||||
else
|
else
|
||||||
echo " → Installing via cPanel package manager..."
|
echo " → Installing via cPanel package manager..."
|
||||||
|
|
||||||
|
# Check if cPanel scripts exist before using them
|
||||||
|
if [ -f "/scripts/update_local_rpm_versions" ] && [ -f "/scripts/check_cpanel_rpms" ]; then
|
||||||
/scripts/update_local_rpm_versions --edit target_settings.clamav installed 2>/dev/null || true
|
/scripts/update_local_rpm_versions --edit target_settings.clamav installed 2>/dev/null || true
|
||||||
/scripts/check_cpanel_rpms --fix --targets=clamav 2>&1 | tail -3
|
if ! /scripts/check_cpanel_rpms --fix --targets=clamav 2>&1 | tail -3; then
|
||||||
|
# cPanel scripts failed, fall back to standard yum
|
||||||
|
echo " → cPanel package manager unavailable, trying standard yum..."
|
||||||
|
yum install -y clamav clamav-update 2>&1 | grep -E "Installing|Installed|already" || echo " (installation in progress)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# cPanel scripts don't exist, fall back to standard yum
|
||||||
|
echo " → cPanel tools not available, using standard package manager..."
|
||||||
|
yum install -y clamav clamav-update 2>&1 | grep -E "Installing|Installed|already" || echo " (installation in progress)"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
# IMPORTANT: Don't fall through to standard yum - cPanel packages conflict!
|
# IMPORTANT: Don't fall through to standard yum - cPanel packages conflict!
|
||||||
elif [ -f "/usr/local/psa/version" ]; then
|
elif [ -f "/usr/local/psa/version" ]; then
|
||||||
@@ -2307,8 +2319,8 @@ show_scan_menu() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Build reference database once for the entire menu session
|
# Build reference database once for the entire menu session
|
||||||
if command -v build_reference_database &>/dev/null; then
|
if command -v db_ensure_fresh &>/dev/null; then
|
||||||
build_reference_database 2>/dev/null || true
|
db_ensure_fresh 2>/dev/null || true
|
||||||
clear
|
clear
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user