From 896a607b0915ad87cabece64eb652572bc6244e8 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Mon, 16 Mar 2026 19:14:37 +0100 Subject: [PATCH] systemctl-wrapper.sh: Beautify logging Apply some more ASCII-art to systemctl-wrapper.sh's output. Signed-off-by: Jan Lindemann --- scripts/systemctl-wrapper.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/scripts/systemctl-wrapper.sh b/scripts/systemctl-wrapper.sh index 1a570f8b..4f580fce 100644 --- a/scripts/systemctl-wrapper.sh +++ b/scripts/systemctl-wrapper.sh @@ -3,14 +3,16 @@ reason="" systemctl="/usr/bin/systemctl" -[ "$(ps -p 1 -o comm=)" = "systemd" ] || reason="Trying to run $exe in an environment not controlled by Systemd" -[ -x $systemctl ] || reason="Can't run $exe." -if [ "$reason" ]; then - title="$reason. Ignoring." - echo ",-- $title -- >" - echo "| $0 $@" - echo "\`-- $title -- <" - exit 0 +if [ "$(ps -p 1 -o comm=)" != "systemd" ]; then + reason="Trying to run $exe in an environment not controlled by Systemd" +elif [ ! -x $systemctl ]; then + reason="Can't run $systemctl" +else + exec $systemctl "$@" fi -exec $systemctl "$@" +title="------------ $reason ------------" +echo ",$title >" +echo "| Ignored: systemctl $@" +echo "\`$title <" +exit 0