mirror of https://github.com/lukechilds/umbrel.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
742 B
23 lines
742 B
#!/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 <<EOF > "$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 <<EOF > "$UMBREL_ROOT"/statuses/update-status.json
|
|
{"state": "failed", "progress": 100, "description": "${memory_error}", "updateTo": "${RELEASE}"}
|
|
EOF
|
|
fi
|
|
exit 1
|
|
fi
|
|
|