From 7f934b4470a9cb3fb6cd80cad98a33032ef25f9b Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 7 Apr 2021 15:46:56 +0200 Subject: [PATCH] Use updater instead of config version (#1301) --- .../rootfs-overlay/usr/sbin/hassos-supervisor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor b/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor index ac34238e1..a98bc9ca7 100755 --- a/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor +++ b/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor @@ -9,9 +9,10 @@ set -e . /etc/os-release # Init supervisor +SUPERVISOR_DATA=/mnt/data/supervisor SUPERVISOR_STARTUP_MARKER="/run/supervisor/startup-marker" SUPERVISOR_IMAGE="homeassistant/${SUPERVISOR_ARCH}-hassio-supervisor" -SUPERVISOR_DATA=/mnt/data/supervisor + SUPERVISOR_IMAGE_ID=$(docker images --no-trunc --filter "reference=${SUPERVISOR_IMAGE}:latest" --format "{{.ID}}" || echo "") SUPERVISOR_CONTAINER_ID=$(docker inspect --format='{{.Image}}' hassio_supervisor || echo "") @@ -35,8 +36,7 @@ if [ -z "${SUPERVISOR_IMAGE_ID}" ]; then # Get the latest from update information # Using updater information instead of config. If the config version is # broken, this creates a way (e.g., bad release). - SUPERVISOR_VERSION_UPDATER=$(jq -r '.version // empty' "${SUPERVISOR_DATA}/config.json" || echo "") - SUPERVISOR_VERSION="${SUPERVISOR_VERSION_UPDATER:-latest}" + SUPERVISOR_VERSION=$(jq -r '.supervisor // "latest"' "${SUPERVISOR_DATA}/updater.json" || echo "latest") echo "[WARNING] Supervisor image missing, downloading a fresh one: ${SUPERVISOR_VERSION}"