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
This commit is contained in:
@@ -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://)
|
||||
|
||||
Reference in New Issue
Block a user