From a140122c6c408632c495f58e285e79097c345e09 Mon Sep 17 00:00:00 2001 From: Viacheslav Bocharov <64684523+adeepn@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:15:46 +0300 Subject: [PATCH] Fix check online in DEBIAN/postinst from ping to curl (#370) * Fix check online in DEBIAN/postinst from ping to curl In some virtual machines ping sockets may be disabled, but curl works good. Signed-off-by: Viacheslav Bocharov * Update URL_CHECK_ONLINE to https://checkonline.home-assistant.io/online.txt --------- Signed-off-by: Viacheslav Bocharov --- homeassistant-supervised/DEBIAN/postinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant-supervised/DEBIAN/postinst b/homeassistant-supervised/DEBIAN/postinst index 11f337d..19e6c60 100755 --- a/homeassistant-supervised/DEBIAN/postinst +++ b/homeassistant-supervised/DEBIAN/postinst @@ -14,7 +14,7 @@ SERVICE_DOCKER="docker.service" SERVICE_NM="NetworkManager.service" # Read infos from web -URL_CHECK_ONLINE="checkonline.home-assistant.io" +URL_CHECK_ONLINE="https://checkonline.home-assistant.io/online.txt" URL_VERSION="https://version.home-assistant.io/stable.json" HASSIO_VERSION=$(curl -s ${URL_VERSION} | jq -e -r '.supervisor') URL_APPARMOR_PROFILE="https://version.home-assistant.io/apparmor.txt" @@ -65,7 +65,7 @@ info "Restarting docker service" systemctl restart "${SERVICE_DOCKER}" # Check network connection -while ! ping -c 1 -W 1 ${URL_CHECK_ONLINE}; do +while ! curl -q ${URL_CHECK_ONLINE} >/dev/null 2>&1 ; do info "Waiting for ${URL_CHECK_ONLINE} - network interface might be down..." sleep 2 done