bugfix v4

This commit is contained in:
pvizeli 2017-03-23 16:53:58 +01:00
parent b8f2758379
commit 516f803a02
4 changed files with 18 additions and 13 deletions

View File

@ -79,10 +79,10 @@ if tag=$(curl --silent $ENDPOINT | jq -e -r '.supervisor_tag'); then
fi fi
fi fi
if [ -z $UPDATER_SUPERVISOR_TAG ]; then if [ ! -z $UPDATER_SUPERVISOR_TAG ]; then
tag=$UPDATER_SUPERVISOR_TAG tag=$UPDATER_SUPERVISOR_TAG
fi fi
if [ -z $UPDATER_SUPERVISOR_IMAGE ]; then if [ ! -z $UPDATER_SUPERVISOR_IMAGE ]; then
image_name=$UPDATER_SUPERVISOR_IMAGE image_name=$UPDATER_SUPERVISOR_IMAGE
fi fi
@ -115,6 +115,10 @@ systemctl start resin-supervisor
# Mark supervisor as working. This version will run when the device reboots. # Mark supervisor as working. This version will run when the device reboots.
echo "Mark pulled tag as latest..." 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_IMAGE=.*|SUPERVISOR_IMAGE=$image_name|" /etc/resin-supervisor/supervisor.conf
sed --in-place "s|SUPERVISOR_TAG=.*|SUPERVISOR_TAG=$tag|" /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

View File

@ -1 +1 @@
HASSIO_VERSION=%HASSIO_VERSION% HASSIO_VERSION=@HASSIO_VERSION@

View File

@ -1,7 +1,6 @@
#!/bin/bash #!/bin/bash
# Default values # Default values
TAG=1.0
LOGFILE=/tmp/`basename "$0"`.log LOGFILE=/tmp/`basename "$0"`.log
LOG=yes LOG=yes
ONLY_SUPERVISOR=no ONLY_SUPERVISOR=no
@ -197,18 +196,18 @@ done
# Check that HostOS version was provided # Check that HostOS version was provided
if [ -z "$HOSTOS_VERSION" ]; then if [ -z "$HOSTOS_VERSION" ]; then
if version=$(curl $ENDPOINT | jq -e -r '.hassio_version') if version=$(curl --silent $ENDPOINT | jq -e -r '.hassio_version'); then
HOSTOS_VERSION=version HOSTOS_VERSION=$version
else else
log ERROR "--hostos-version is required." log ERROR "--hostos-version is required."
fi fi
fi fi
if [ -z $RESINHUP_VERSION ]; then if [ -z $RESINHUP_VERSION ]; then
if version=$(curl $ENDPOINT | jq -e -r '.resinhub_version') if version=$(curl --silent $ENDPOINT | jq -e -r '.resinhup_version'); then
HOSTOS_VERSION=version RESINHUP_VERSION=$version
else else
log ERROR "--hostos-version is required." log ERROR "--resinhup-version is required."
fi fi
fi fi
@ -220,6 +219,8 @@ if [ "$LOG" == "yes" ]; then
fi fi
# Check if update is needed # Check if update is needed
log "Detected HassIO version: $HASSIO_VERSION ."
log "Update HassIO to version: $HOSTOS_VERSION ."
if [ $HASSIO_VERSION == $HOSTOS_VERSION ]; then if [ $HASSIO_VERSION == $HOSTOS_VERSION ]; then
log "Version $HOSTOS_VERSION is already installed." log "Version $HOSTOS_VERSION is already installed."
exit 0 exit 0

View File

@ -1,6 +1,6 @@
{ {
"supervisor_tag": "20170319", "supervisor_tag": "20170322",
"homeassistant_tag": "0.40.1", "homeassistant_tag": "0.40.1",
"hassio_version": "0.1", "hassio_version": "0.1",
"resinhup_version": "1.1.1", "resinhup_version": "1.1.1"
} }