#!/bin/bash
# file   : mount_clients
# author : Jacek Radajewski
# date   : 22 May 1997
#
#  
#-------------------------------------------------------------------
# check if started from alpha 
#-------------------------------------------------------------------

if [ $(/bin/uname -n) != "alpha.beowulf.usq.edu.au" ] ; then
    echo "$0 : I must be started from alpha.beowulf.usq.edu.au"
    echo "$0 : I was started from $(/bin/uname -n)"
    exit 1
fi

#-------------------------------------------------------------------
# mount /spare of all clients on each client
#-------------------------------------------------------------------

for server_host in $(cat /usr/local/admin/hosts) ; do
    for  client_host in $(cat /usr/local/admin/hosts) ; do
	echo -n "mounting /$server_host on $client_host ... "
	rsh $client_host "/bin/mount -v -t nfs $server_host:/spare /$server_host &"
    done;
done;


