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 <adeep@lexina.in>

* Update URL_CHECK_ONLINE to https://checkonline.home-assistant.io/online.txt

---------

Signed-off-by: Viacheslav Bocharov <adeep@lexina.in>
This commit is contained in:
Viacheslav Bocharov 2024-06-21 15:15:46 +03:00 committed by GitHub
parent 6669bf6aca
commit a140122c6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,7 @@ SERVICE_DOCKER="docker.service"
SERVICE_NM="NetworkManager.service" SERVICE_NM="NetworkManager.service"
# Read infos from web # 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" URL_VERSION="https://version.home-assistant.io/stable.json"
HASSIO_VERSION=$(curl -s ${URL_VERSION} | jq -e -r '.supervisor') HASSIO_VERSION=$(curl -s ${URL_VERSION} | jq -e -r '.supervisor')
URL_APPARMOR_PROFILE="https://version.home-assistant.io/apparmor.txt" URL_APPARMOR_PROFILE="https://version.home-assistant.io/apparmor.txt"
@ -65,7 +65,7 @@ info "Restarting docker service"
systemctl restart "${SERVICE_DOCKER}" systemctl restart "${SERVICE_DOCKER}"
# Check network connection # 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..." info "Waiting for ${URL_CHECK_ONLINE} - network interface might be down..."
sleep 2 sleep 2
done done