mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
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:
parent
c893584e5e
commit
896a607b09
1 changed files with 11 additions and 9 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue