Register
It is currently Fri Oct 31, 2014 6:53 am

making a boot floppy


All times are UTC - 6 hours


Post new topic Reply to topic  [ 1 post ] 
Author Message
 PostPosted: Tue May 17, 2005 7:37 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
originally posted here at usalug.org

Code:
#!/bin/bash
# Author: Joshua Bailey
# Name: floppywrite
# Syntax: floppywrite fileToBeWritten.img
# This script writes an image file to a floppy

# Uncomment next line to unmount for auto-mounting systems
# umount /dev/fd0 2> /dev/null

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

for those of you who hate using a windows box to make your boot image floppies


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP