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"