From 2d7f21fe395031012c26811f54d53b26b1876a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sat, 1 Aug 2026 22:19:07 +0200 Subject: [PATCH] bookworm, trixie: check_connection: Try using curl, wget before ping ping is ICMP packets, usually blocked by many contextes (qemu user, VPNs, company networks). Also, maybe servers would have a wrong date and fail the https handshake. This is not what we aim to test here. Relying on simple HTTP is more reliable. Co-authored-by: ljf (zamentur) --- bookworm | 8 +++++++- trixie | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bookworm b/bookworm index eff9d14..e1ff6d3 100755 --- a/bookworm +++ b/bookworm @@ -34,7 +34,13 @@ function check_connection() { TIMEOUT=$1 while [ "$TIMEOUT" -gt 0 ]; do - ping -c 1 -W 2 yunohost.org > /dev/null 2>&1 && return 0 + if command -v curl >/dev/null 2>&1; then + curl -I -m 2 http://yunohost.org -o /dev/null --silent && return 0 + elif command -v wget >/dev/null 2>&1; then + wget --spider --timeout 2 http://yunohost.org -O /dev/null --quiet && return 0 + else + ping -c 1 -W 2 yunohost.org > /dev/null 2>&1 && return 0 + fi sleep 1 TIMEOUT=$((TIMEOUT - 1)) done diff --git a/trixie b/trixie index 2648117..675ad8d 100755 --- a/trixie +++ b/trixie @@ -33,7 +33,13 @@ function check_connection() { TIMEOUT=$1 while [ "$TIMEOUT" -gt 0 ]; do - ping -c 1 -W 2 yunohost.org > /dev/null 2>&1 && return 0 + if command -v curl >/dev/null 2>&1; then + curl -I -m 2 http://yunohost.org -o /dev/null --silent && return 0 + elif command -v wget >/dev/null 2>&1; then + wget --spider --timeout 2 http://yunohost.org -O /dev/null --quiet && return 0 + else + ping -c 1 -W 2 yunohost.org > /dev/null 2>&1 && return 0 + fi sleep 1 TIMEOUT=$((TIMEOUT - 1)) done