systemctl-wrapper.sh: Beautify logging

Apply some more ASCII-art to systemctl-wrapper.sh's output.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-16 19:14:37 +01:00
commit 896a607b09

View file

@ -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