fix: pass SYSTEMD_COLORS=1 to systemctl/journalctl for colored output

systemctl and journalctl use their own color detection (SYSTEMD_COLORS env
var) independently of the terminal — child processes don't always inherit
it. Force colors for status and logs subcommands of update and backup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 19:18:17 +02:00
co-authored by Claude Sonnet 4.6
parent 65acede0a5
commit 4276a5b94e
+4 -4
View File
@@ -510,14 +510,14 @@ EOF
status)
if systemctl cat stacks-update.timer &>/dev/null; then
systemctl status stacks-update.timer stacks-update.service --no-pager 2>/dev/null || true
SYSTEMD_COLORS=1 systemctl status stacks-update.timer stacks-update.service --no-pager 2>/dev/null || true
else
warn "Update service not installed"
fi
;;
logs)
journalctl -u stacks-update.service "${@}" --no-pager 2>/dev/null \
SYSTEMD_COLORS=1 journalctl -u stacks-update.service "${@}" --no-pager 2>/dev/null \
|| warn "No update logs found (is the service installed?)"
;;
@@ -667,14 +667,14 @@ EOF
status)
if systemctl cat stacks-backup.timer &>/dev/null; then
systemctl status stacks-backup.timer stacks-backup.service --no-pager 2>/dev/null || true
SYSTEMD_COLORS=1 systemctl status stacks-backup.timer stacks-backup.service --no-pager 2>/dev/null || true
else
warn "Backup service not installed"
fi
;;
logs)
journalctl -u stacks-backup.service "${@}" --no-pager 2>/dev/null \
SYSTEMD_COLORS=1 journalctl -u stacks-backup.service "${@}" --no-pager 2>/dev/null \
|| warn "No backup logs found (is the service installed?)"
;;