Files
proxmox/scripts/deployment/set-missing-dotenv-chain138.sh

39 lines
1.5 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
# Append missing Chain 138 / DODO PMM env vars to smom-dbis-138/.env (no overwrite, no secrets).
# Usage: ./scripts/deployment/set-missing-dotenv-chain138.sh
# From smom-dbis-138: ../scripts/deployment/set-missing-dotenv-chain138.sh (if called from there, adjust path)
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
ENV_FILE="${SMOM_ENV_FILE:-$PROJECT_ROOT/smom-dbis-138/.env}"
if [[ ! -f "$ENV_FILE" ]]; then
echo "Error: $ENV_FILE not found. Create it from env.additions.example or copy from .env.example." >&2
exit 1
fi
append_if_missing() {
local key="$1"
local value="$2"
if ! grep -qE "^${key}=" "$ENV_FILE" 2>/dev/null; then
echo "${key}=${value}" >> "$ENV_FILE"
echo " Added: $key"
fi
}
echo "=== Set missing dotenv (Chain 138 / DODO PMM) ==="
echo " Target: $ENV_FILE"
echo ""
append_if_missing "DODO_PMM_PROVIDER_ADDRESS" "0x3f729632E9553EBacCdE2e9b4c8F2B285b014F2e"
append_if_missing "DODO_PMM_INTEGRATION_ADDRESS" "0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895"
append_if_missing "POOL_CUSDTCUSDC" "0x9e89bAe009adf128782E19e8341996c596ac40dC"
append_if_missing "POOL_CUSDTUSDT" "0x866Cb44b59303d8dc5f4F9E3E7A8e8b0bf238d66"
append_if_missing "POOL_CUSDCUSDC" "0xc39B7D0F40838cbFb54649d327f49a6DAC964062"
append_if_missing "CHAIN_138_DODO_PMM_INTEGRATION" "0x86ADA6Ef91A3B450F89f2b751e93B1b7A3218895"
echo ""
echo "Done. Verify: grep -E 'DODO_PMM|POOL_' $ENV_FILE"