fix(stacks): show correct status when update service has failed

systemctl status exits non-zero for failed services (exit 3), not
only missing ones (exit 4), causing the || warn branch to always fire
after a failed run. Gate the "not installed" warning on whether the
unit file exists instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 02:21:00 +02:00
co-authored by Claude Sonnet 4.6
parent a08c5fca39
commit 04a79ea198
+5 -2
View File
@@ -508,8 +508,11 @@ EOF
;;
status)
systemctl status stacks-update.timer stacks-update.service --no-pager 2>/dev/null \
|| warn "Update service not installed"
if systemctl cat stacks-update.timer &>/dev/null; then
systemctl status stacks-update.timer stacks-update.service --no-pager 2>/dev/null || true
else
warn "Update service not installed"
fi
;;
logs)