From ab5e8cbd7ccc3041bd14abb964a670cefa70cd67 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 29 Jan 2026 14:35:00 -0500 Subject: [PATCH] [FEAT] Immich: Enable Maintenance Mode before update (#11342) * [FEAT] Immich: enable Maintenance Mode prior to update - Checks if current version is 2.5.2 or higher - Also disables Maintenance Mode afterwards * fix pathing issue; suppress `cd -` output --- ct/immich.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ct/immich.sh b/ct/immich.sh index 75475e438..79a0d92c0 100644 --- a/ct/immich.sh +++ b/ct/immich.sh @@ -114,6 +114,14 @@ EOF RELEASE="2.5.2" if check_for_gh_release "immich" "immich-app/immich" "${RELEASE}"; then + if [[ $(cat ~/.immich) > "2.5.1" ]]; then + msg_info "Enabling Maintenance Mode" + cd /opt/immich/app/bin + $STD bash ./immich-admin enable-maintenance-mode + export MAINT_MODE=1 + $STD cd - + msg_ok "Enabled Maintenance Mode" + fi msg_info "Stopping Services" systemctl stop immich-web systemctl stop immich-ml @@ -242,6 +250,14 @@ EOF ln -s "$GEO_DIR" "$APP_DIR" chown -R immich:immich "$INSTALL_DIR" + if [[ "$MAINT_MODE" == 1 ]]; then + msg_info "Disabling Maintenance Mode" + cd /opt/immich/app/bin + $STD bash ./immich-admin disable-maintenance-mode + unset MAINT_MODE + $STD cd - + msg_ok "Disabled Maintenance Mode" + fi systemctl restart immich-ml immich-web msg_ok "Updated successfully!" fi