diff --git a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/update-resin-supervisor b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/update-resin-supervisor index 08736350f..3462a5fdf 100644 --- a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/update-resin-supervisor +++ b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/update-resin-supervisor @@ -79,10 +79,10 @@ if tag=$(curl --silent $ENDPOINT | jq -e -r '.supervisor_tag'); then fi fi -if [ -z $UPDATER_SUPERVISOR_TAG ]; then +if [ ! -z $UPDATER_SUPERVISOR_TAG ]; then tag=$UPDATER_SUPERVISOR_TAG fi -if [ -z $UPDATER_SUPERVISOR_IMAGE ]; then +if [ ! -z $UPDATER_SUPERVISOR_IMAGE ]; then image_name=$UPDATER_SUPERVISOR_IMAGE fi @@ -115,6 +115,10 @@ systemctl start resin-supervisor # Mark supervisor as working. This version will run when the device reboots. echo "Mark pulled tag as latest..." -docker tag -f "$image_name:$tag" "$image_name:latest" +docker tag "$image_name:$tag" "$image_name:latest" sed --in-place "s|SUPERVISOR_IMAGE=.*|SUPERVISOR_IMAGE=$image_name|" /etc/resin-supervisor/supervisor.conf sed --in-place "s|SUPERVISOR_TAG=.*|SUPERVISOR_TAG=$tag|" /etc/resin-supervisor/supervisor.conf + +# cleanup old image +echo "Cleanup old supervisor" +docker rmi $SUPERVISOR_IMAGE:$SUPERVISOR_TAG || true diff --git a/meta-hassio/recipes-support/resinhup/resinhup/hassio.conf b/meta-hassio/recipes-support/resinhup/resinhup/hassio.conf index c811787dc..570f504ef 100644 --- a/meta-hassio/recipes-support/resinhup/resinhup/hassio.conf +++ b/meta-hassio/recipes-support/resinhup/resinhup/hassio.conf @@ -1 +1 @@ -HASSIO_VERSION=%HASSIO_VERSION% +HASSIO_VERSION=@HASSIO_VERSION@ diff --git a/meta-hassio/recipes-support/resinhup/resinhup/run-resinhup.sh b/meta-hassio/recipes-support/resinhup/resinhup/run-resinhup.sh index a43a75bf8..911469334 100644 --- a/meta-hassio/recipes-support/resinhup/resinhup/run-resinhup.sh +++ b/meta-hassio/recipes-support/resinhup/resinhup/run-resinhup.sh @@ -1,7 +1,6 @@ -#!/bin/bash +#!/bin/bash # Default values -TAG=1.0 LOGFILE=/tmp/`basename "$0"`.log LOG=yes ONLY_SUPERVISOR=no @@ -197,18 +196,18 @@ done # Check that HostOS version was provided if [ -z "$HOSTOS_VERSION" ]; then - if version=$(curl $ENDPOINT | jq -e -r '.hassio_version') - HOSTOS_VERSION=version + if version=$(curl --silent $ENDPOINT | jq -e -r '.hassio_version'); then + HOSTOS_VERSION=$version else log ERROR "--hostos-version is required." fi fi if [ -z $RESINHUP_VERSION ]; then - if version=$(curl $ENDPOINT | jq -e -r '.resinhub_version') - HOSTOS_VERSION=version + if version=$(curl --silent $ENDPOINT | jq -e -r '.resinhup_version'); then + RESINHUP_VERSION=$version else - log ERROR "--hostos-version is required." + log ERROR "--resinhup-version is required." fi fi @@ -220,6 +219,8 @@ if [ "$LOG" == "yes" ]; then fi # Check if update is needed +log "Detected HassIO version: $HASSIO_VERSION ." +log "Update HassIO to version: $HOSTOS_VERSION ." if [ $HASSIO_VERSION == $HOSTOS_VERSION ]; then log "Version $HOSTOS_VERSION is already installed." exit 0 diff --git a/version_beta.json b/version_beta.json index 21ccef488..ac338d34a 100644 --- a/version_beta.json +++ b/version_beta.json @@ -1,6 +1,6 @@ { - "supervisor_tag": "20170319", + "supervisor_tag": "20170322", "homeassistant_tag": "0.40.1", "hassio_version": "0.1", - "resinhup_version": "1.1.1", + "resinhup_version": "1.1.1" }