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:
+4
-4
@@ -510,14 +510,14 @@ EOF
|
|||||||
|
|
||||||
status)
|
status)
|
||||||
if systemctl cat stacks-update.timer &>/dev/null; then
|
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
|
else
|
||||||
warn "Update service not installed"
|
warn "Update service not installed"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
logs)
|
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?)"
|
|| warn "No update logs found (is the service installed?)"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -667,14 +667,14 @@ EOF
|
|||||||
|
|
||||||
status)
|
status)
|
||||||
if systemctl cat stacks-backup.timer &>/dev/null; then
|
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
|
else
|
||||||
warn "Backup service not installed"
|
warn "Backup service not installed"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
logs)
|
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?)"
|
|| warn "No backup logs found (is the service installed?)"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user