home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / live / etc / init.d / checkfs.sh < prev    next >
Text File  |  1998-06-21  |  728b  |  41 lines

  1. #
  2. # checkfs.sh    Check all filesystems.
  3. #
  4. # Version:    @(#)checkfs  1.10  22-Jun-1998  miquels@cistron.nl
  5. #
  6.  
  7. . /etc/default/rcS
  8.  
  9. #
  10. # Check the rest of the file systems.
  11. #
  12. if [ ! -f /fastboot ]
  13. then
  14.     if [ -f /forcefsck ]
  15.     then
  16.         force="-f"
  17.     else
  18.         force=""
  19.     fi
  20.     if [ "$FSCKFIX"  = yes ]
  21.     then
  22.     fix="-y"
  23.     else
  24.     fix="-a"
  25.     fi
  26.     echo "Checking all file systems..."
  27.     fsck -R -A $fix $force
  28.     if [ $? -gt 1 ]
  29.     then
  30.       echo
  31.       echo "fsck failed.  Please repair manually."
  32.       echo
  33.       echo "CONTROL-D will exit from this shell and continue system startup."
  34.       echo
  35.       # Start a single user shell on the console
  36.       /sbin/sulogin $CONSOLE
  37.     fi
  38. fi
  39. rm -f /fastboot /forcefsck
  40.  
  41.