Monday, May 28, 2007

Improved floppy bash script

Aloha,
I improved my floppy bash script by setting it up with a variable and clarifying a few things. I am making it GPL'd, have to investigate how to do that correctly, and added some additional comments. Here it is...
#!/bin/bash
#Title: makefloppy Written by: Edward Haddock Date: 5/28/07
#License: GPL This can be copied and modified for your own use.
#A bash script to format floppies then change the owner to me
#and set the permission up correctly.
#First use fdisk to create the partition on the floppy.
#Then use mke2fs to format it
mke2fs $1
#Now mount, change ownership, then unmount
mount -t ext2 $1 /media/disk
chown -R edward:edward /media/disk
chmod -R 755 /media/disk
umount $1
#Remove and resinsert the floppy, it's mine now with the right permissions.
Mahalo,
Edward

No comments: