Files
proxmox/scripts/archive/small-scripts/ssh-proxmox.sh

28 lines
715 B
Bash
Raw Normal View History

#!/usr/bin/env bash
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
# SSH to Proxmox host with locale warnings suppressed
# Usage: ./scripts/ssh-proxmox.sh [command]
HOST="${PROXMOX_HOST:-192.168.11.10}"
USER="${PROXMOX_USER:-root}"
# Suppress locale warnings
export LC_ALL=C
export LANG=C
if [[ $# -eq 0 ]]; then
# Interactive SSH (suppress locale warnings)
ssh "$USER@$HOST" "export LC_ALL=C; export LANG=C; bash"
else
# Execute command (suppress locale warnings)
ssh "$USER@$HOST" "export LC_ALL=C; export LANG=C; $@"
fi