diff --git a/scripts/notify-bootc-user.sh b/scripts/notify-bootc-user.sh index 372a839..e68e701 100755 --- a/scripts/notify-bootc-user.sh +++ b/scripts/notify-bootc-user.sh @@ -16,11 +16,10 @@ $BOOTC upgrade # 2. Status-Check # PRÜFUNG ANGEPASST: Wir prüfen, ob der Status EXPLIZIT 'staged: null' enthält. # Wenn dies der Fall ist, bedeutet es "System aktuell". -if $BOOTC status --json | grep -q '"staged": null"'; then - # KEIN Update gefunden (Status ist null) +if $BOOTC status --json | jq -e '.status.staged == null' >/dev/null; then + # KEIN Update gefunden $LOGGER -t "$TAG" "System aktuell (keine Updates vorhanden)." else - # Ein Update ist gestaged oder der Status ist nicht null. Wir senden die Benachrichtigung. # 3. Den ersten User finden, der nicht Root ist USER_ID=$($LOGINCTL list-users --no-legend | awk '$2 != "root" {print $1; exit}')