#!/bin/bash # Author: Joshua Bailey # Name: floppywrite # Syntax: floppywrite # This script writes an image file to a floppy COMPL=0 while [[ $COMPL -eq 0 ]] do if [[ ! -e /dev/fd0 ]] then echo "Your floppy doesn't appear to be at /dev/fd0" read -p "Please type the path to your floppy drive: " FLOPPY else FLOPPY=/dev/fd0 fi if [[ $# -eq 1 ]] then FILEN=$1 fi if [[ ${#FILEN} = 0 ]] then read -p "Please specify a target file to be written: " FILEN fi if [[ -f $FILEN ]] then dd if=$FILEN of=$FLOPPY bs=1024 conv=sync ; sync COMPL=1 echo "*** Done ***" else echo "$FILEN does not exist or the path is incorrect!" read -p "Try again? [y|n] " ANS ANS=`echo $ANS | tr [:upper:] [:lower:]` if [[ ${ANS:0:1} = "n" ]] then exit else read -p "Please specify a target file to be written: " FILEN fi fi done