-
-
Save davegallant/13c4c6c3d1e0fe28fd373089335ebd48 to your computer and use it in GitHub Desktop.
A helper for Proxmox's "pct enter" to use containers' hostnames and enter them from any cluster node.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
id=$(grep "$1" /etc/pve/.rrd | cut -d'/' -f 2 | cut -d':' -f 1) | |
[[ "$id" == '' ]] && echo "The specified LXC does not exist." && exit 1 | |
node=$(grep "^\"$id\":" /etc/pve/.vmlist | cut -d'"' -f 6) | |
[[ $(hostname) != "$node" ]] && pre="ssh -t $node " | |
echo "Entering LXC $id on node $node..." | |
${pre}pct enter $id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment