From 36b1335fe9768fb0d38b025d64d831bf4bd4d5f9 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 30 Nov 2024 11:40:05 +0100 Subject: [PATCH] feat: some more debugging Signed-off-by: kjuulh --- install.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 097ac6c..fc4c477 100644 --- a/install.sh +++ b/install.sh @@ -37,9 +37,14 @@ chmod +x "${INSTALL_DIR}/${BINARY_NAME}" res=$(churn agent setup --discovery "${CHURN_DISCOVERY}" 2>&1) exit_code=$? +echo "Debug - Full output: $res" +echo "Debug - Exit code: $exit_code" + if [[ $exit_code != 0 ]]; then - if [[ "$res" != *"config file already exists"* ]]; then - echo "$res" + # Convert to lowercase to make matching more reliable + res_lower=$(echo "$res" | tr '[:upper:]' '[:lower:]') + if [[ "$res_lower" != *"config file already exists"* ]] && [[ "$res_lower" != *"already exists"* ]]; then + echo "Error: $res" exit 1 fi fi