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=""
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue