From 9486d0604a0c326e940b7caee5ddc2a2de091949 Mon Sep 17 00:00:00 2001 From: Developer Date: Tue, 21 Apr 2026 20:26:22 -0400 Subject: [PATCH] Fix: Add timeout to GitHub API curl to prevent hanging Issue: Checking for latest release was hanging and closing SSH connection Solution: Add --connect-timeout 5 and --max-time 10 to curl command - Prevents indefinite blocking on network issues - Falls back to v2.0.1-rc4 if API unreachable - Script continues even if GitHub API is slow/down --- modules/security/malware-scanner.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/security/malware-scanner.sh b/modules/security/malware-scanner.sh index 785e21d..aa159b0 100755 --- a/modules/security/malware-scanner.sh +++ b/modules/security/malware-scanner.sh @@ -285,9 +285,9 @@ install_maldet_only() { rm -f "$temp_file" fi - # Get latest release dynamically from GitHub API + # Get latest release dynamically from GitHub API (with timeout) local latest_release - latest_release=$(curl -s "https://api.github.com/repos/rfxn/linux-malware-detect/releases/latest" 2>/dev/null | grep -o '"tag_name":"[^"]*' | head -1 | cut -d'"' -f4) + latest_release=$(curl -s --connect-timeout 5 --max-time 10 "https://api.github.com/repos/rfxn/linux-malware-detect/releases/latest" 2>/dev/null | grep -o '"tag_name":"[^"]*' | head -1 | cut -d'"' -f4) # Download sources in priority order # Format: "name|url|label" (using | as delimiter to avoid splitting https://)