#!/bin/bash
# Script to copy files to multiple nodes
# Do "export NODES=<path to file with nodenames>" to use 
# file other than /etc/nodes

if [ "$1" == "" ]
	then
	echo "Usage:"
	echo "$0 <source> <destination>"
	exit
fi 

if [ "$NODES" != "" ]
	then
	Nodes=$NODES
	else	
	Nodes=/etc/nodes
fi 

Nodelist=`cat $Nodes`

for node in $Nodelist
  do
    scp -q $1 $node:$2 &
  done


wait
