infra-generale/execute_script_all.sh
2022-05-21 00:18:32 +02:00

9 lines
183 B
Bash
Executable file

#!/bin/bash
script=$1
VMs=$(sudo virsh list --state-running --name | grep chalec)
for vm in $VMs
do
echo Executing script $script on $vm ...
ssh $vm 'bash -s' < $script
done