home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 16 / hacker16 / 16_HACKER16.ISO / linux / tpm-security-server-1.2.1.iso / etc / rc.d / init.d / mountext2 < prev    next >
Encoding:
Text File  |  2004-01-27  |  956 b   |  46 lines

  1. #!/bin/sh
  2.  
  3. . /etc/init.d/functions
  4.  
  5. #This command retrieves all the IDE hard drive names
  6. DISCS=`find /dev/ide -name disc`
  7.  
  8. USRHOME=0
  9. USRLOCAL=0
  10. ETC=0
  11.  
  12. #Next, examine each IDE hard drive's partition table
  13. # and try to mount any ext2 partitions
  14. for PART in $DISCS ; do
  15.     BASENAME=`dirname $PART`
  16.     cd $BASENAME
  17.     LINUXPARTS=`sfdisk -d disc | grep -i "Id=83" | awk '{ print $1 }'`
  18.     for PARTTOMOUNT in $LINUXPARTS ; do
  19.         LABEL=`e2label $BASENAME/$PARTTOMOUNT`
  20.         if [ "x$LABEL" = "x/usr/local" ]; then
  21.             if [ $USRLOCAL -eq 0 ]; then
  22.                 echo "mounting /usr/local"
  23.                 mount $BASENAME/$PARTTOMOUNT /usr/local
  24.                 USRLOCAL=1
  25.             fi
  26.         fi
  27.  
  28.         if [ "x$LABEL" = "x/etc" ]; then
  29.             if [ $ETC -eq 0 ]; then
  30.                 echo "mounting /etc"
  31.                 mount $BASENAME/$PARTTOMOUNT /etc
  32.                 ETC=1
  33.             fi
  34.         fi
  35.  
  36.         if [ "x$LABEL" = "x/usr/home" ]; then
  37.             if [ $USRHOME -eq 0 ]; then
  38.                 echo "mounting /usr/home"
  39.                 mount $BASENAME/$PARTTOMOUNT /usr/home
  40.                 USRHOME=1
  41.             fi
  42.         fi
  43.  
  44.     done
  45. done
  46.