From ece5d5d1a1bc2fe359b9065e3ac181e02a8f1090 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 30 Apr 2018 18:29:41 +0200 Subject: [PATCH] snippets/base_script.sh: add check if systemd is supported --- snippets/base_script.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/snippets/base_script.sh b/snippets/base_script.sh index 17bc0cc..654147b 100755 --- a/snippets/base_script.sh +++ b/snippets/base_script.sh @@ -196,6 +196,16 @@ else terminal=false fi +# -Is systemd supported on this system? +# - +systemd_supported=false +systemd=$(which systemd) +systemctl=$(which systemctl) + +if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then + systemd_supported=true +fi + # - Print help? # - if [[ "$(trim $*)" = "-h" ]] || [[ "$(trim $*)" = "--help" ]] ; then