infra-generale/execute_cmd_all.sh

10 lines
138 B
Bash
Executable File

#!/bin/bash
command=$1
VMs=$(sudo virsh list --state-running --name)
for vm in $VMs
do
echo Executing on $vm ...
ssh $vm $1
done