#!/bin/bash

# Script to copy a floppy disk into a temp directory and write it to a fresh disk.
# It will pause after copying the original disk and wait for the user to press
# Enter to continue with writing the new disk.  This gives the user the 
# opportunity to insert a blank disk for writing to.

# Step 1: Copy the contents of the original disk to a temp directory
mount /dev/fd0
mkdir /tmp/flopcop
cp -a /mnt/floppy/* /tmp/flopcop/

# Step 2: Unmount the disk and wait for user input to continue
umount /mnt/floppy
echo "Insert blank disk and press <Enter> to continue..."
#sleep 15
read

# Step 3: Write the data to the new disk
mount /dev/fd0
cp -a /tmp/flopcop/* /mnt/floppy/
rm -Rf /tmp/flopcop
umount /mnt/floppy
echo "Remove disk!"

# All done
