Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- 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>
49 lines
1.7 KiB
Bash
Executable File
49 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Clean ml110 - Remove old files before syncing
|
|
# This is a separate script for safety
|
|
|
|
set -euo pipefail
|
|
|
|
# Load IP configuration
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
|
|
|
|
|
|
REMOTE_HOST="${PROXMOX_HOST_ML110}"
|
|
REMOTE_USER="root"
|
|
REMOTE_BASE="/opt"
|
|
|
|
log_info() { echo "[INFO] $1"; }
|
|
log_warn() { echo "[WARN] $1"; }
|
|
log_error() { echo "[ERROR] $1"; }
|
|
|
|
log_warn "=== WARNING: This will DELETE all files in:"
|
|
log_warn " - ${REMOTE_BASE}/smom-dbis-138-proxmox"
|
|
log_warn " - ${REMOTE_BASE}/smom-dbis-138 (config and keys will be preserved if you run sync script)"
|
|
log_warn ""
|
|
read -p "Are you sure you want to delete these directories? (type 'DELETE' to confirm): " confirm
|
|
|
|
if [[ "$confirm" != "DELETE" ]]; then
|
|
log_info "Aborted by user"
|
|
exit 0
|
|
fi
|
|
|
|
# Create backup first
|
|
BACKUP_DIR="/opt/backup-$(date +%Y%m%d-%H%M%S)"
|
|
log_info "Creating backup at ${BACKUP_DIR}..."
|
|
sshpass -p 'L@kers2010' ssh -o StrictHostKeyChecking=no "${REMOTE_USER}@${REMOTE_HOST}" \
|
|
"mkdir -p ${BACKUP_DIR} && \
|
|
(test -d ${REMOTE_BASE}/smom-dbis-138 && cp -r ${REMOTE_BASE}/smom-dbis-138 ${BACKUP_DIR}/ || true) && \
|
|
(test -d ${REMOTE_BASE}/smom-dbis-138-proxmox && cp -r ${REMOTE_BASE}/smom-dbis-138-proxmox ${BACKUP_DIR}/ || true) && \
|
|
echo 'Backup created'"
|
|
|
|
log_info "Removing old directories..."
|
|
sshpass -p 'L@kers2010' ssh -o StrictHostKeyChecking=no "${REMOTE_USER}@${REMOTE_HOST}" \
|
|
"rm -rf ${REMOTE_BASE}/smom-dbis-138-proxmox && \
|
|
echo '✓ Removed smom-dbis-138-proxmox'"
|
|
|
|
log_info "✓ Cleanup complete"
|
|
log_info "Backup saved at: ${BACKUP_DIR}"
|
|
|