From 5d0fdd25c8ba26720623e1f9cd72b8340d66ee17 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 20 Feb 2014 11:44:01 +0000 Subject: [PATCH] Warn the developer on wrong function usage --- bootstrap-salt.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 39877a0..22321d5 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1261,6 +1261,12 @@ movefile() { # PARAMETERS: servicename #---------------------------------------------------------------------------------------------------------------------- __check_services_systemd() { + if [ $# -eq 0 ]; then + echoerror "You need to pass a service name to check!" + exit 1 + elif [ $# -ne 0 ]; then + echoerror "You need to pass a service name to check as the single argument to the function" + fi servicename=$? if [ $(systemctl is-enabled ${servicename}) = "enabled" ]; then return 0