#!/bin/sh STRING="Checking other filesystems" fsck -R -T -a -C -A 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 -n -a mount -n -o remount,ro / echo "Automatic reboot in progress." reboot -f fi echo "Mounting other filesystems" mount -a -n if [ -e /swapfile ]; then echo "Turning on swap" chmod 600 /swapfile swapon /swapfile fi