#!/bin/sh STRING="Checking root filesystem" fsck -R -T -a -C / RC=$? if [ "$RC" = "0" ]; then echo "$STRING: Success" elif [ "$RC" = "1" ]; then echo "$STRING: Passed" fi # A return of 2 or higher means there were serious problems. if [ $RC -gt 1 ]; then echo "$STRING: Failed" echo "*** An error occurred during the file system check." echo "*** Dropping you to a shell; the system will reboot" echo "*** when you leave the shell." export PS1="(Repair filesystem) \# # " sulogin echo "Unmounting filesystems" umount -a mount -n -o remount,ro / echo "Automatic reboot in progress." reboot -f fi echo "Mounting root read/write" mount -n -o remount,rw /