From b375c64e8bf896af231b09cac41bfcb6364d3d2e Mon Sep 17 00:00:00 2001
From: Sotiris Tsepelakis <sotirios.tsepelakis@tuwien.ac.at>
Date: Mon, 24 Jul 2023 14:02:17 +0200
Subject: [PATCH] Minor fix in SMTP script

Use docker compose exec in conjunction with curl
---
 scripts/add-smtp-credentials.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/add-smtp-credentials.sh b/scripts/add-smtp-credentials.sh
index e4d650e..e76b5bf 100755
--- a/scripts/add-smtp-credentials.sh
+++ b/scripts/add-smtp-credentials.sh
@@ -33,7 +33,11 @@ username=$(grep -E "^OPENSEARCH_ADMIN_USERNAME=" .env | cut -d '=' -f 2- || echo
 password=$(grep -E "^OPENSEARCH_ADMIN_PASSWORD=" .env | cut -d '=' -f 2- || echo "admin")
 
 # reload settings for changes to take effect
-response=$(curl -s -u "${username}:${password}" -w "\n%{http_code}" -X POST https://localhost:9200/_nodes/reload_secure_settings --cacert ./ssl/root-ca-crt.pem)
+response=$(docker compose exec os-node-1 curl -s \
+    -u "${username}:${password}" \
+    -w "\n%{http_code}" \
+    -X POST https://localhost:9200/_nodes/reload_secure_settings \
+    --cacert /usr/share/opensearch/config/root-ca.pem)
 
 # separate response message and HTTP status code
 response_message=$(echo "$response" | sed '$d')
-- 
GitLab