battery.sh: Check network reachability before version check

This commit is contained in:
base47
2026-02-14 00:20:26 +01:00
parent 6fb7abb11c
commit ba94751a92

View File

@@ -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"
}