#--- Perform download ---------------------------------------------------- HTTP_RESPONSE=$(curl -sS -w "%http_code" -H "Authorization: Bearer $API_KEY" \ -H "Accept: application/x-yaml" \ -o "$FILE_NAME" "$URL")
if ($response.StatusCode -ne 200) Write-Error "❌ HTTP $($response.StatusCode) – download failed" exit 1 lmc 8.4 config file download r18
# Download file $response = Invoke-WebRequest -Uri $Url -Headers $Headers -OutFile $OutFile -ErrorAction Stop lmc 8.4 config file download r18
echo "✅ Config file downloaded and verified: $DEST_DIR/$FILE_NAME" # ------------------------------------------------- # LMC 8.4 – R18 config file download (PowerShell) # ------------------------------------------------- lmc 8.4 config file download r18
LOCAL_CHECKSUM=$(sha256sum "$FILE_NAME" | awk 'print $1')
# Retrieve checksum from response header $ServerChecksum = $response.Headers["X-Config-Checksum"] if (-not $ServerChecksum) Write-Warning "⚠️ Server did not return a checksum header – skipping verification"
#--- Variables --------------------------------------------------------- LMC_HOST="lmc.example.com" API_KEY="$LMC_API_KEY" # export LMC_API_KEY=xxxxx beforehand DEST_DIR="/opt/lmc/config" FILE_NAME="lmc_config_r18.yaml" URL="https://$LMC_HOST/api/v1/config/download?rev=18"