From b0ec41fa93371ea1eb9c5139052388c166e9bb6e Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 30 Nov 2024 11:35:24 +0100 Subject: [PATCH] feat: when config has already been setup Signed-off-by: kjuulh --- install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index b4962c0..0e2296e 100644 --- a/install.sh +++ b/install.sh @@ -35,7 +35,14 @@ curl -L "https://api-minio.front.kjuulh.io/${S3_BUCKET}/releases/${APP_NAME}/${A # Make binary executable chmod +x "${INSTALL_DIR}/${BINARY_NAME}" -churn agent setup --discovery "${CHURN_DISCOVERY}" +res=$(churn agent setup --discovery "${CHURN_DISCOVERY}") +exit_code=$? +if [[ $exit_code != 0 ]]; then + if [[ "$res" != *"Error: config file already exists"* ]]; then + echo "$res" + exit 1 + fi +fi # Create systemd service file echo "Creating systemd service..."