#!/usr/bin/env bash set -euo pipefail RELEASE=$1 UMBREL_ROOT=$2 first_run=$3 # Abort on low memory devices if true; then if [[ "${first_run}" == "firstrun" ]]; then cat < "$UMBREL_ROOT"/statuses/update-status.json {"state": "installing", "progress": 20, "description": "Checking device memory", "updateTo": "${RELEASE}"} EOF # Sleep for a few seconds so the user has been redirected to the update screen sleep 10 memory_error="Sorry, this update isn't compatible with your device, it requires at least 2GB RAM." echo "${memory_error}" cat < "$UMBREL_ROOT"/statuses/update-status.json {"state": "failed", "progress": 100, "description": "${memory_error}", "updateTo": "${RELEASE}"} EOF fi exit 1 fi