Refactor code for improved readability and performance
This commit is contained in:
19
scripts/ssh-proxmox.sh
Executable file
19
scripts/ssh-proxmox.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user