Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kerus1024/69526b637e26b5c270a07cba56981b7b to your computer and use it in GitHub Desktop.
Save kerus1024/69526b637e26b5c270a07cba56981b7b to your computer and use it in GitHub Desktop.
#!/bin/bash
get_lxc_list=`pvesh ls /nodes/localhost/lxc | awk '{ print $2 }'`
lxc_list=($get_lxc_list)
for container_id in "${lxc_list[@]}"
do
echo CT : $container_id
pct exec $container_id 'hostname' &
done
echo
wait
echo "ok"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment