From ba94751a92f5ae7ae115e37e4f9f63c00e8db653 Mon Sep 17 00:00:00 2001 From: base47 Date: Sat, 14 Feb 2026 00:20:26 +0100 Subject: [PATCH] battery.sh: Check network reachability before version check --- battery.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/battery.sh b/battery.sh index 17c7548..2514d10 100755 --- a/battery.sh +++ b/battery.sh @@ -534,6 +534,9 @@ function fixup_installation_owner_mode() { } function is_latest_version_installed() { + # Check if content is reachable first with HEAD request + curl -sSI "$github_url_battery_sh" &>/dev/null || return 0 + # Start downloading and check version curl -sS "$github_url_battery_sh" 2>/dev/null | grep -q "$BATTERY_CLI_VERSION" }