Files
proxmox/scripts/load-env.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

45 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Standardized .env loader function
# This ensures all scripts use the same ~/.env file consistently
# Load environment variables from ~/.env file
# Usage: source load-env.sh or . load-env.sh
load_env_file() {
local env_file="${HOME}/.env"
if [[ -f "$env_file" ]]; then
# Source PROXMOX_* variables from ~/.env
set -a
source <(grep -E "^PROXMOX_" "$env_file" 2>/dev/null | sed 's/^/export /' || true)
set +a
# Ensure PROXMOX_TOKEN_SECRET is set from PROXMOX_TOKEN_VALUE for backwards compatibility
if [[ -z "${PROXMOX_TOKEN_SECRET:-}" ]] && [[ -n "${PROXMOX_TOKEN_VALUE:-}" ]]; then
export PROXMOX_TOKEN_SECRET="${PROXMOX_TOKEN_VALUE}"
fi
return 0
else
return 1
fi
}
# Auto-load if sourced directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
# Script is being executed directly
load_env_file
if [[ $? -eq 0 ]]; then
echo "✅ Loaded environment from ~/.env"
echo "PROXMOX_HOST=${PROXMOX_HOST:-not set}"
echo "PROXMOX_USER=${PROXMOX_USER:-not set}"
echo "PROXMOX_TOKEN_NAME=${PROXMOX_TOKEN_NAME:-not set}"
echo "PROXMOX_TOKEN_VALUE=${PROXMOX_TOKEN_VALUE:+***configured***}"
else
echo "❌ ~/.env file not found"
exit 1
fi
fi