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


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

Me=`hostname -s`
Nodelist=`cat $Nodes|grep -v -x $Me`

for node in $Nodelist
  do
    ssh $node /sbin/poweroff
  done

