[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
This commit is contained in:
Chris
2026-01-29 14:35:00 -05:00
committed by GitHub
parent 69e563afb5
commit ab5e8cbd7c

View File

@@ -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