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="" reason=""
systemctl="/usr/bin/systemctl" systemctl="/usr/bin/systemctl"
[ "$(ps -p 1 -o comm=)" = "systemd" ] || reason="Trying to run $exe in an environment not controlled by Systemd" if [ "$(ps -p 1 -o comm=)" != "systemd" ]; then
[ -x $systemctl ] || reason="Can't run $exe." reason="Trying to run $exe in an environment not controlled by Systemd"
if [ "$reason" ]; then elif [ ! -x $systemctl ]; then
title="$reason. Ignoring." reason="Can't run $systemctl"
echo ",-- $title -- >" else
echo "| $0 $@" exec $systemctl "$@"
echo "\`-- $title -- <"
exit 0
fi fi
exec $systemctl "$@" title="------------ $reason ------------"
echo ",$title >"
echo "| Ignored: systemctl $@"
echo "\`$title <"
exit 0