Files
proxmox/scripts/archive/consolidated/verify/check-container-services.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

60 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Check services for a single container
# Usage: ./check-container-services.sh <VMID>
# 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
VMID=$1
PROXMOX_HOST="${PROXMOX_HOST:-${PROXMOX_HOST_R630_02:-192.168.11.12}}"
if [ -z "$VMID" ]; then
echo "Usage: $0 <VMID>"
exit 1
fi
exec_container() {
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=3 root@"$PROXMOX_HOST" "pct exec $VMID -- bash -c '$*'" 2>&1
}
echo "=== VMID $VMID ==="
CONTAINER_INFO=$(ssh -o StrictHostKeyChecking=no root@"$PROXMOX_HOST" "pct list | grep '^$VMID'" 2>&1)
NAME=$(echo "$CONTAINER_INFO" | awk '{print $3}')
STATUS=$(echo "$CONTAINER_INFO" | awk '{print $2}')
echo "Name: $NAME"
echo "Status: $STATUS"
if [ "$STATUS" != "running" ]; then
echo "Container not running"
exit 0
fi
# Get IP
IP=$(exec_container "hostname -I | awk '{print \$1}'" 2>&1 | head -1)
echo "IP: ${IP:-unknown}"
# Check services
echo "Services:"
SERVICES="nginx apache2 docker blockscout cloudflared postgresql mysql mariadb redis gitea firefly"
for svc in $SERVICES; do
STATUS_CHECK=$(exec_container "systemctl is-active $svc 2>/dev/null || echo 'inactive'" 2>&1)
if [ "$STATUS_CHECK" = "active" ]; then
echo "$svc: active"
fi
done
# Check Docker
DOCKER=$(exec_container "command -v docker >/dev/null 2>&1 && docker ps --format '{{.Names}}' | head -5 | tr '\n' ' ' || echo 'no'" 2>&1)
if [ "$DOCKER" != "no" ] && [ -n "$DOCKER" ]; then
echo " Docker containers: $DOCKER"
fi
# Disk usage
DISK=$(exec_container "df -h / | tail -1 | awk '{print \$5 \" (\" \$3 \"/\" \$2 \")\"}'" 2>&1)
echo "Disk usage: ${DISK:-unknown}"