Files
proxmox/scripts/maintenance/start-firefly-6201.sh

38 lines
1.3 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
# Start container 6201 (firefly-ali-1) on r630-02. Optional; run when Firefly Ali node is needed.
# Usage: bash scripts/maintenance/start-firefly-6201.sh [--dry-run] [--host HOST]
# Requires: SSH key access to the Proxmox host (r630-02).
set -euo pipefail
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
[ -f "${PROJECT_ROOT}/.env" ] && set +u && source "${PROJECT_ROOT}/.env" 2>/dev/null; set -u
VMID=6201
PROXMOX_HOST="${PROXMOX_HOST_R630_02:-192.168.11.12}"
DRY_RUN=false
while [[ $# -gt 0 ]]; do
case "$1" in
--dry-run) DRY_RUN=true; shift ;;
--host) PROXMOX_HOST="${2:-192.168.11.12}"; shift 2 ;;
*) shift ;;
esac
done
if [[ "$DRY_RUN" == true ]]; then
echo "[DRY-RUN] Would run: ssh root@${PROXMOX_HOST} 'pct start ${VMID}'"
echo " (Container 6201 = firefly-ali-1 on r630-02. See OPERATIONAL_RUNBOOKS Maintenance.)"
exit 0
fi
echo "Starting CT ${VMID} (firefly-ali-1) on ${PROXMOX_HOST}..."
if ssh -o ConnectTimeout=10 -o BatchMode=yes "root@${PROXMOX_HOST}" "pct start ${VMID}"; then
echo "Started ${VMID}."
else
echo "Failed to start ${VMID} (may already be running or host unreachable). Check: ssh root@${PROXMOX_HOST} 'pct status ${VMID}'"
exit 1
fi