#!/bin/sh
			if [ -f formatscript ]; then
			rm formatscript
			fi
cat >formatscript <<END_OF_DATA

#
#  Format all partitions on disk $disk -- created by getdiskinfo
#
echo ""
echo "This script will format all partitions on disk $disk."
echo ""
echo "IT WILL DESTROY ALL DATA ON DISK $disk !!!!"
echo ""
if [ ! -f noprompt ];then
echo -n "Are you sure you want to continue? yes/no: "
read a
if [ x\$a != xyes ] ; then
   exit 1
fi 
fi
if [ ! -f badblocksnoprompt ];then
echo "Do you want to do a disk check for bad blocks?"
echo -n "It is recommended, but takes time. yes/no: "
read a
if [ x\$a = xyes ] ; then
  check="-c"
else
   check=
fi
fi
END_OF_DATA


	

		dis=${disk%?}


		formatscripto=`ls working/scripts |grep $dis|grep format`
		
			cat working/scripts/$formatscripto |grep $disk|while read line;do
			echo $line >>formatscript

			done
		grep mk formatscript>>/dev/null 2>&1
		if [ $? = 0 ];then
		cat formatscript>>formatallscript
		fi
		rm formatscript
