Auto-upgrade: Fix when no users are active

This commit is contained in:
fruchti 2025-07-17 09:32:10 +02:00
parent 408893cd7f
commit 9aae1f5f83

View file

@ -165,7 +165,7 @@ in
activate_configuration="no"
# Check if any user sessions are open
active_users=$(users | tr ' ' '\n' | sort | uniq | grep -vE '^(${concatStringsSep "|" cfg.rebootIgnoreUsersActive})$')
active_users=$(users | tr ' ' '\n' | sort | uniq | grep -vE '^(${concatStringsSep "|" cfg.rebootIgnoreUsersActive})$' || true)
if [ "$reboot_allowed" = "yes" ] && [ -n "$active_users" ] ; then
reboot_allowed=no
email_body="$(printf "%s\n%s\n%s" "$email_body" "The system cannot reboot since the following users are active:" "$active_users")"