Fix successful Hermes stable updates without commit changes

This commit is contained in:
admin committed 2026-10-21 16:27:16 +02:00
1 parent c6dba0b9ec
commit 8a4a01c42f
4 files changed
+118 -1

No files matched your search

+8 -1
View File
@@ -15,6 +15,8 @@ log() {
notify_user() {
local text="$1"
# Keep the outcome in this service's journal as well as the notifier's journal.
printf '%s\n' "$text"
if [[ -x "$NOTIFIER" ]]; then
"$NOTIFIER" "$text" || true
else
@@ -226,7 +228,12 @@ mapfile -t old_backups < <(
((${#old_backups[@]} == 0)) || rm -f -- "${old_backups[@]}"
new_commit="$(git -C "$HERMES_REPO" rev-parse HEAD)"
if [[ "$new_commit" == "$old_commit" ]]; then
# The updater selects the configured channel (e.g. stable), whereas the fetch
# above only checks remote connectivity. Stable may legitimately stay on the
# same commit even when origin/main has advanced.
if [[ "$new_commit" == "$old_commit" ]] && ((update_exit == 0)); then
notify_user "Hermes ist im konfigurierten Update-Kanal bereits aktuell: $new_commit. Konfiguration und frisch gestarteter Gateway sind gesund."
elif [[ "$new_commit" == "$old_commit" ]]; then
notify_user "Hermes-Update wurde nicht installiert (Updater-Exitcode $update_exit); der bisherige Commit $new_commit und der frisch gestartete Gateway sind gesund."
exit 1
elif ((update_exit != 0)); then