jw-pkg/scripts/systemctl-wrapper.sh
Jan Lindemann 896a607b09 systemctl-wrapper.sh: Beautify logging
Apply some more ASCII-art to systemctl-wrapper.sh's output.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 19:14:41 +01:00

18 lines
384 B
Bash

#!/bin/bash
reason=""
systemctl="/usr/bin/systemctl"
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
title="------------ $reason ------------"
echo ",$title >"
echo "| Ignored: systemctl $@"
echo "\`$title <"
exit 0