home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- . /etc/init.d/functions
-
- if [ -e /etc/interactiveboot ]; then
- echo "Automatically mount all DOS/NTFS partitions from IDE hard drives?"
- read A
- if [ "x$A" = "xn" -o "x$A" = "xN" ]; then
- exit 0
- fi
- fi
-
-
- #This command retrieves all the IDE hard drive names
- DISCS=`find /dev/ide -name disc`
-
- #The first DOS mount would be 'c' drive, and in ASCII 'c' is 99
- NEXTMOUNT=99
-
-
- #Next, examine each IDE hard drive's partition table
- # and try to mount any Microsoft partitions
- for PART in $DISCS ; do
- DRIVEDEV=`dirname $PART`
- cd $DRIVEDEV
- DOSPARTS=`sfdisk -l disc |egrep "FAT|NTFS" | awk '{ print $1 }'`
- for PARTTOMOUNT in $DOSPARTS ; do
- DOSPATH=`echo "$NEXTMOUNT" | awk '{printf "/mnt/ms/drive%c",$1}' `
- echo "Mounting $PARTTOMOUNT on $DOSPATH"
- if [ ! -d $DOSPATH ] ; then
- echo "Creating mount point $DOSPATH"
- mkdir -p $DOSPATH
- fi
- mount $DRIVEDEV/$PARTTOMOUNT $DOSPATH
- let NEXTMOUNT++
- if [ $NEXTMOUNT -gt 122 ] ; then exit ; fi
- done
- done
-