if [ -f /forcefsck ]; then
FORCEFSCK="-f"
fi
# Check filesystems
/sbin/fsck $FORCEFSCK -A -T -C -a
if [ $? -gt 1 ]; then
echo
echo "*************** FILESYSTEM CHECK FAILED ******************"
echo "* *"
echo "* Please repair manually and reboot. Note that the root *"
echo "* file system is currently mounted read-only. To remount *"
echo "* it read-write type: mount -n -o remount,rw / *"
echo "* When you exit the maintainance shell the system will *"
echo "* reboot automatically. *"
echo "* *"
echo "************************************************************"
echo
/sbin/sulogin -p
echo "Automatic reboot in progress..."
/bin/umount -a -r
/bin/mount -n -o remount,ro /
/sbin/reboot -f
exit 0
fi