From 9cdc0b50857dcf690507e38fe3743d7e35ef0e09 Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 3 Feb 2026 16:53:20 -0700 Subject: [PATCH] Upgrade script does not report upgrade being complete when it actually fails. --- upgrade.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/upgrade.sh b/upgrade.sh index 9b5d7f9b..106ccb84 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -70,10 +70,22 @@ if [ -z "$WROLPI_UPGRADE_SERVICE" ]; then exit $EXIT_CODE fi +# Clean up and report status on exit. +trap ' + EXIT_STATUS=$? + rm -f /tmp/wrolpi-upgrade.env + if [ $EXIT_STATUS -eq 0 ]; then + echo "WROLPi upgrade has completed" + else + echo "WROLPi upgrade has FAILED (exit code: $EXIT_STATUS)" + fi +' EXIT + echo "Upgrading WROLPi from branch: ${BRANCH}" set -x set -e +set -o pipefail systemctl stop wrolpi-api systemctl stop wrolpi-app @@ -86,5 +98,3 @@ systemctl stop wrolpi-app set +x echo "Upgrade end $(date '+%Y-%m-%d %H:%M:%S')" >>/opt/wrolpi/upgrade.log - -echo "WROLPi upgrade has completed"