From 395c020bcd66e8e1037fd655b9a07371819efaa7 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 20 Feb 2014 11:48:20 +0000 Subject: [PATCH] Fix logic and quoting --- bootstrap-salt.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 682e066..f2f9a30 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1264,11 +1264,11 @@ __check_services_systemd() { if [ $# -eq 0 ]; then echoerror "You need to pass a service name to check!" exit 1 - elif [ $# -ne 0 ]; then + elif [ $# -ne 1 ]; 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 + servicename=$1 + if [ "$(systemctl is-enabled ${servicename})" = "enabled" ]; then return 0 else return 1