2022-01-04 06:04:27 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-01-28 06:52:26 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
2022-01-04 06:04:27 +00:00
|
|
|
#
|
2022-01-21 20:37:48 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2022-01-04 06:04:27 +00:00
|
|
|
|
|
|
|
CITADEL_ROOT="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../..)"
|
|
|
|
|
2022-05-15 14:57:05 +00:00
|
|
|
cat <<EOF > "$CITADEL_ROOT"/statuses/update-status.json
|
|
|
|
{"state": "installing", "progress": 20, "description": "Downloading updates", "updateTo": "$RELEASE"}
|
|
|
|
EOF
|
|
|
|
"${CITADEL_ROOT}/scripts/app" update &
|
|
|
|
cat <<EOF > "$CITADEL_ROOT"/statuses/update-status.json
|
|
|
|
{"state": "installing", "progress": 30, "description": "Downloading updates", "updateTo": "$RELEASE"}
|
|
|
|
EOF
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
cat <<EOF > "$CITADEL_ROOT"/statuses/update-status.json
|
|
|
|
{"state": "installing", "progress": 50, "description": "Downloading updates", "updateTo": "$RELEASE"}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
wait
|
|
|
|
|
|
|
|
"${CITADEL_ROOT}/scripts/app" start installed &
|
|
|
|
cat <<EOF > "$CITADEL_ROOT"/statuses/update-status.json
|
|
|
|
{"state": "installing", "progress": 60, "description": "Starting apps", "updateTo": "$RELEASE"}
|
|
|
|
EOF
|
|
|
|
sleep 15
|
|
|
|
cat <<EOF > "$CITADEL_ROOT"/statuses/update-status.json
|
|
|
|
{"state": "installing", "progress": 70, "description": "Starting apps", "updateTo": "$RELEASE"}
|
|
|
|
EOF
|
|
|
|
sleep 10
|
|
|
|
cat <<EOF > "$CITADEL_ROOT"/statuses/update-status.json
|
|
|
|
{"state": "installing", "progress": 80, "description": "Starting apps", "updateTo": "$RELEASE"}
|
|
|
|
EOF
|
|
|
|
sleep 5
|
|
|
|
cat <<EOF > "$CITADEL_ROOT"/statuses/update-status.json
|
|
|
|
{"state": "installing", "progress": 90, "description": "Starting apps", "updateTo": "$RELEASE"}
|
|
|
|
EOF
|
|
|
|
wait
|
|
|
|
cat <<EOF > "$CITADEL_ROOT"/statuses/update-status.json
|
|
|
|
{"state": "success", "progress": 100, "description": "Update successful", "updateTo": "$RELEASE"}
|
|
|
|
EOF
|