home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- . /etc/init.d/functions
-
- #This command retrieves all the IDE hard drive names
- DISCS=`find /dev/ide -name disc`
-
- USRHOME=0
- USRLOCAL=0
- ETC=0
-
- #Next, examine each IDE hard drive's partition table
- # and try to mount any ext2 partitions
- for PART in $DISCS ; do
- BASENAME=`dirname $PART`
- cd $BASENAME
- LINUXPARTS=`sfdisk -d disc | grep -i "Id=83" | awk '{ print $1 }'`
- for PARTTOMOUNT in $LINUXPARTS ; do
- LABEL=`e2label $BASENAME/$PARTTOMOUNT`
- if [ "x$LABEL" = "x/usr/local" ]; then
- if [ $USRLOCAL -eq 0 ]; then
- echo "mounting /usr/local"
- mount $BASENAME/$PARTTOMOUNT /usr/local
- USRLOCAL=1
- fi
- fi
-
- if [ "x$LABEL" = "x/etc" ]; then
- if [ $ETC -eq 0 ]; then
- echo "mounting /etc"
- mount $BASENAME/$PARTTOMOUNT /etc
- ETC=1
- fi
- fi
-
- if [ "x$LABEL" = "x/usr/home" ]; then
- if [ $USRHOME -eq 0 ]; then
- echo "mounting /usr/home"
- mount $BASENAME/$PARTTOMOUNT /usr/home
- USRHOME=1
- fi
- fi
-
- done
- done
-