Advertisement
peetaur

proxmox list containers on al nodes

Jul 22nd, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.27 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. IFS=$'\n'
  4. for line in $(cat /root/.ssh/authorized_keys); do
  5.     host=$(echo "$line" | grep -Eo "@.*$" | tr -d @)
  6.     if [ ! -e "/etc/pve/nodes/$host" ]; then
  7.         continue
  8.     fi
  9.     echo "Containers on ${host}:"
  10.     ssh "$host" "vzlist -a"
  11. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement