#!/bin/bash
# ************************************************************
# *
# * Name: MAKEADISK
# *
# * Desc: Build a DSD image file in the ../dasd subdirectory
# *       $1 = volume serial
# *       $2 = cua
# *
# ************************************************************
PATH=../hercules:${PATH}
THISDIR=`pwd`
cd ..
GENDIR=`pwd`
cd ${THISDIR}

if ! test -d ../log
then
  mkdir -p ../log
fi
echo "Building the" $1 "dasd image file"
if test -f ../dasd/$1.$2
then
   rm -f ../dasd/$1.$2
fi
if test -f ../dasd/$1
then
   rm -f ../dasd/$1
fi
dasdload ../conf/$1.ctl ../dasd/$1 >../log/mak$1.log 2>&1
cd ../dasd
ckd2cckd $1 $1.$2
cckdcdsk -3 $1.$2 >>../log/mak$1.log 2>&1
rm -f $1
