diff --git a/default.inc b/default.inc index 4b436b6..ebfb298 100755 --- a/default.inc +++ b/default.inc @@ -161,6 +161,15 @@ DIVIDER(){ echo "" fi } + +service_exists() { + local n=$1 + if [[ $(systemctl list-units --all -t service --full --no-legend "$n.service" | sed 's/^\s*//g' | cut -f1 -d' ') == $n.service ]]; then + return 0 + else + return 1 + fi +} declare -A abet