#!/bin/bash
# ************************************************************
# *
# * Name: RESTSNAP
# *
# * Desc: Restore a full snapshot
# *
# ************************************************************
PATH=../hercules:${PATH}
THISDIR=`pwd`
cd ..
GENDIR=`pwd`
cd ${THISDIR}

if [ "$#" = "0" ]
then
   clear
   echo "* There is one required parameter!"
   echo "*"
   echo "* USAGE: $0 [snapshot_number]"
   echo " "
   exit
fi
if [ "${1}" = "01" ]
then
   sh restsnapvol 01 mvsres
   sh restsnapvol 01 mvsdlb
   sh restsnapvol 01 start1
   sh restsnapvol 01 spool0
elif [ "${1}" = "02" ]
then
   sh restsnapvol 02 mvsres
   sh restsnapvol 02 mvsdlb
   sh restsnapvol 02 start1
   sh restsnapvol 02 spool0
elif [ "${1}" = "03" ]
then
   sh restsnapvol 03 mvsres
   sh restsnapvol 03 mvsdlb
   sh restsnapvol 03 start1
   sh restsnapvol 03 spool0
elif [ "${1}" = "04" ]
then
   sh restsnapvol 04 mvsres
   sh restsnapvol 04 mvsdlb
   sh restsnapvol 04 start1
   sh restsnapvol 04 spool0
else
   clear
   echo "* You have are trying to restore Snapshot "${1}"."
   echo "* This snapshot could not be found in the snapshot directory"
   echo "* Are you sure you have specified the correct snapshot number?"
   echo "*"
   echo "* USAGE: $0 [snapshot_number]"
   echo "*"
   echo "* Press the ENTER key to continue"
   read dummy
   exit
fi
