#!/bin/bash

# Dead simple script to execute the same command on several machines in one go
# Give the command as an argument to the script
# Shared key authentication and having all nodes on same subnet helps ;)
# I'm fully aware of better ways of doing this, but none that'd take me 60 seconds to set up

echo "Executing $1 locally"
sh -c $1
echo "Done..."
for I in 20 40 50 60 80 90 
do
echo "Executing $1 on $I..."
ssh 10.0.0.$I "$1"
echo "Done..."
done

