Files
proxmox/scripts/archive/small-scripts/automate-phase4-sync-config.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

47 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# Phase 4: Sync configuration to secondary
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
if [ -f "$PROJECT_ROOT/.env" ]; then
set +euo pipefail
source "$PROJECT_ROOT/.env" 2>/dev/null || true
set -euo pipefail
fi
log_info() { echo -e "\033[0;34m[INFO]\033[0m $1"; }
log_success() { echo -e "\033[0;32m[✓]\033[0m $1"; }
log_warn() { echo -e "\033[1;33m[⚠]\033[0m $1"; }
log_info "Syncing configuration to secondary..."
# Export from primary
log_info "Exporting primary configuration..."
EXPORT_DIR=$(bash "$SCRIPT_DIR/export-primary-config.sh" 2>&1 | grep "exported to" | awk '{print $NF}' || echo "")
if [ -z "$EXPORT_DIR" ] || [ ! -d "$EXPORT_DIR" ]; then
log_warn "Could not determine export directory, trying default location..."
EXPORT_DIR=$(ls -td /tmp/npmplus-config-backup-* 2>/dev/null | head -1 || echo "")
fi
if [ -n "$EXPORT_DIR" ] && [ -d "$EXPORT_DIR" ]; then
log_info "Importing to secondary..."
bash "$SCRIPT_DIR/import-secondary-config.sh" "$EXPORT_DIR" || {
log_warn "Import failed, but continuing..."
}
log_success "Configuration sync attempted"
else
log_warn "Export directory not found, skipping import"
fi
# Sync certificates
log_info "Syncing certificates..."
bash "$SCRIPT_DIR/sync-certificates.sh" || {
log_warn "Certificate sync failed"
}
log_success "Phase 4 complete: Configuration sync attempted"