fix: Pass API credentials directly to curl instead of via env vars

This commit is contained in:
Muhammad Ibrahim
2025-10-02 13:41:12 +01:00
parent dc68afcb87
commit 51982010db

View File

@@ -4,7 +4,7 @@ set -euo pipefail # Exit on error, undefined vars, pipe failures
# Trap to catch any unexpected exits
trap 'echo "[ERROR] Script exited unexpectedly at line $LINENO with exit code $?"' ERR EXIT
SCRIPT_VERSION="1.0.0-debug.8"
SCRIPT_VERSION="1.0.0-debug.9"
echo "[DEBUG] Script Version: $SCRIPT_VERSION ($(date +%Y-%m-%d\ %H:%M:%S))"
# =============================================================================
@@ -196,12 +196,10 @@ while IFS= read -r line; do
# Download and execute in separate steps to avoid stdin issues with piping
install_output=$(timeout 180 pct exec "$vmid" -- bash -c "
export API_ID='$api_id'
export API_KEY='$api_key'
cd /tmp
curl $CURL_FLAGS \
-H 'X-API-ID: \$API_ID' \
-H 'X-API-KEY: \$API_KEY' \
-H \"X-API-ID: $api_id\" \
-H \"X-API-KEY: $api_key\" \
-o patchmon-install.sh \
'$PATCHMON_URL/api/v1/hosts/install' && \
bash patchmon-install.sh && \