#!/bin/bash
# file   : reboot_all
# author : Jacek Radajewski
# date   : 23 May 1997
# script to reboot all the clients and then server alpha
# this script must be executed from alpha

#-------------------------------------------------------------------
# first 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

#-------------------------------------------------------------------
# run the reboot_clients script
#-------------------------------------------------------------------

/usr/local/admin/reboot_clients

#-------------------------------------------------------------------
# now server's turn
#-------------------------------------------------------------------

echo "Taking a nap for 3 minutes so clients can reboot"

sleep 180

echo "Now it is my turn ... "

/sbin/shutdown -r now "bye bye"






