:  this is used to make backup disks 
:  rwh    Copyright 1982 Altos Computer Systems
trap 'rm -f junk.?$$ ; echo copy aborted ; exit' 1 2 3 15
echo ${COMMAND=junk} ${NULL=/dev/null} AGAIN=y > /dev/null
until expr $COMMAND : 3 > $NULL
        do echo ;
           echo ;
           echo ;
	   echo 'ALTOS DISK COPY            rev 2.0         July 27, 1982';
	   echo ;
	   echo 'choose :  1 - copy single density disk';
	   echo '          2 - copy double density disk';
	   echo '          3 - quit';
	   echo ;
	   echo -n 'command: ' ;
	   read COMMAND;
	   case $COMMAND in
		  1) echo -n 'insert single density disk, press <return>';
	             AGAIN=y;
		     read LINE;
		     dd if=/dev/fd0.sd of=junk.s$$ bs=1b count=500;
		     while expr $AGAIN : y > $NULL;
			do  
			   echo ;
		           echo -n 'insert blank disk, press <return>';
			   read LINE;
		     	   dd if=junk.s$$ of=/dev/fd0.sd bs=1b count=500;
			   echo ;
			   echo -n 'make another copy of this disk (y or n): ';
			   read AGAIN;
		     done;;
		  2) echo -n 'insert double density disk, press <return>';
	             AGAIN=y;
		     read LINE;
		     dd if=/dev/fd0.boot of=junk.b$$ bs=1b count=13;
		     dd if=/dev/fd0.dd of=junk.t$$ bs=1b count=900;
		     while expr $AGAIN : y > $NULL;
			do
			   echo ;
		           echo -n 'insert blank disk, press <return>';
			   read LINE;
			   dd if=junk.b$$ of=/dev/fd0.boot bs=1b count=13;
		     	   dd if=junk.t$$ of=/dev/fd0.dd bs=1b count=900;
			   echo ;
			   echo -n 'make another copy of this disk (y or n): ';
			   read AGAIN;
		     done;;
	esac;  
done
rm -f junk.?$$
exit 
