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..."