From 6cdc5a1957886a2aea29fc3ff50fd5620405d336 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sat, 26 Sep 2020 12:34:09 +0200 Subject: [PATCH] check_if_service_exists.sh: some minor changes.. --- snippets/check_if_service_exists.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/snippets/check_if_service_exists.sh b/snippets/check_if_service_exists.sh index 7f36926..86c22d6 100755 --- a/snippets/check_if_service_exists.sh +++ b/snippets/check_if_service_exists.sh @@ -35,8 +35,9 @@ usage() { [[ -n "$1" ]] && error "$1" - [[ $terminal ]] && echo -e " +\033[1m--------------------------------------------------\033[m + \033[1mUsage:\033[m $(basename $0) @@ -55,9 +56,9 @@ usage() { \033[1mExample:\033[m - Create a saltet SHA512 password hash + $(basename $0) apache2 - $(basename $0) apache2 +\033[1m--------------------------------------------------\033[m " @@ -247,6 +248,12 @@ if $terminal ; then echo -e "\033[1m----------\033[m" fi +if [[ -z "$SERVICE_NAME" ]] ; then + error "No servive given on command line.." + usage +fi + + blank_line if service_exists $SERVICE_NAME ; then echo -e "\t\033[32mService \033[1m$SERVICE_NAME\033[m\033[32m exists\033[m"