#!/bin/bash
# ************************************************************
# *
# * Name: INS0040
# *
# * Desc: Run hercules to initialize the MVS system residence
# *       and write an IPL text using IHADASDR utility pgm
# *
# *
# * Fixes applied: FIX0001
# *
# *
# ************************************************************
PATH=../hercules:${PATH}
THISDIR=`pwd`
cd ..
GENDIR=`pwd`
CD ${THISDIR}

echo " "
echo "**********************************************************"
echo "*                                                         "
echo "*    *************** D A N G E R *******************      "
echo "*                                                         "
echo "*                                                         "
echo "*    THIS PROCEDURE WILL completely erase all the data    "
echo "*    on your sysres volume                                "
echo "*                                                         "
echo "*             MVSRES                                      "
echo "*                                                         "
echo "*    ONLY RUN THIS IF YOU REALLY WANT TO START THE        "
echo "*    SYSGEN PROCESS FROM AFRESH!!!!!!!!!!!!!!!!!!!        "
echo "*                                                         "
echo "*    *************** D A N G E R *******************      "
echo "*                                                         "
echo "**********************************************************"
echo " "
echo "Press the ENTER key to continue"
echo "or press CTRL-C to abort"
read dummy
if ! test -d ../prt
then
   mkdir ../prt
fi
if ! test -d ../dasd
then
   mkdir ../dasd
fi
cd ../dasd
if ! test -f mvsres_n.148
then
   echo "The non-compressed dasd imnage file "
   echo "              mvsres_n.148          "
   echo "does not exist in the ${GENDIR}/dasd"
   echo "subdirectory.  Did you really run   "
   echo "installation script ins0020??       "
   echo " "
   echo "Press the enter to end this script"
   read dummy
else
   hercules -f ../conf/writeipl.conf >../log/writeipl.log
fi
