#!/usr/bin/env bash set -euo pipefail RELEASE=$1 UMBREL_ROOT=$2 echo echo "=======================================" echo "============= OTA UPDATE ==============" echo "=======================================" echo "=========== Stage: Success ============" echo "=======================================" echo # Delete previous (unused) images echo "Deleting previous images" cat < "$UMBREL_ROOT"/statuses/update-status.json {"state": "installing", "progress": 90, "description": "Deleting previous images", "updateTo": "$RELEASE"} EOF docker image prune --all --force # Cleanup echo "Removing backup" cat < "$UMBREL_ROOT"/statuses/update-status.json {"state": "installing", "progress": 95, "description": "Removing backup"} EOF [[ -d "$UMBREL_ROOT"/.umbrel-backup ]] && rm -rf "$UMBREL_ROOT"/.umbrel-backup echo "Successfully installed Umbrel $RELEASE" cat < "$UMBREL_ROOT"/statuses/update-status.json {"state": "success", "progress": 100, "description": "Successfully installed Umbrel $RELEASE", "updateTo": ""} EOF