From 3a022a95f0bed1f7ab0741d477be266c0b5a11cc Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 29 Apr 2024 13:04:57 +0200 Subject: [PATCH] Adding required is_true function and fixing log Signed-off-by: Daniel --- appliances/lib/common.sh | 13 +++++++++++++ appliances/lib/functions.sh | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/appliances/lib/common.sh b/appliances/lib/common.sh index 921c3ed..f538c75 100644 --- a/appliances/lib/common.sh +++ b/appliances/lib/common.sh @@ -166,3 +166,16 @@ $(echo "${ONE_SERVICE_DESCRIPTION}" | sed -e 's/^\(.\)/ \1/') EOF } + +# arg: +is_true() +{ + _value=$(eval echo "\$${1}" | tr '[:upper:]' '[:lower:]') + case "$_value" in + 1|true|yes|y) + return 0 + ;; + esac + + return 1 +} \ No newline at end of file diff --git a/appliances/lib/functions.sh b/appliances/lib/functions.sh index 297040d..897f896 100644 --- a/appliances/lib/functions.sh +++ b/appliances/lib/functions.sh @@ -229,7 +229,7 @@ _check_service_status() msg info "Starting reconfiguration of the service" return 0 else - msg error "Configure step cannot be run - go check: ${ONE_SERVICE_STATUS}" + msg error "Configure step will not run since the appliance is set as non-reconfigurable. Chech the value of ONE_SERVICE_RECONFIGURABLE" exit 1 fi ;;