File: //opt/resolve/scripts/script.halt
#!/bin/bash
MSG=`cat << EOM
The system will now shutdown.
Proceed?
EOM`
xmessage -center -buttons "Yes":0,"No":1 -default "No" "${MSG}"
if [ ${?} -ne 0 ]
then
exit 0
fi
#This statement Unmounts the NFS Filesystems on GUI machine
/home/resolve/Cyclone/script.umount
REMOTE_SITES=`cat /home/resolve/Cyclone/clients.cp /home/resolve/Cyclone/clients | sort | uniq | grep -v localhost`
for server_ip in ${REMOTE_SITES} localhost
do
echo "Halting ${server_ip}..."
ssh -l root ${server_ip} halt -p
done