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