Ticket #10697: dosfsck.sh

File dosfsck.sh, 785 bytes (added by anonymous, 5 years ago)
Line 
1#!/bin/sh
2# Copyright 2010 Vertical Communications
3# This is free software, licensed under the GNU General Public License v2.
4# See /LICENSE for more information.
5#
6# MODIFIED from ext2/3/4 for dos/vfat - see: http://wiki.openwrt.org/doc/techref/block_mount
7
8fsck_dosfsck() {
9        dosfsck -p "$device" 2>&1 | logger -t "fstab: dosfsck ($device)"
10        local status="$?"
11        case "$status" in
12                0|1) ;; #success
13                2) reboot;;
14                4) echo "dosfsck ($device): Warning! Uncorrected errors."| logger -t fstab
15                        return 1
16                        ;;
17                *) echo "dosfsck ($device): Error $status. Check not complete."| logger -t fstab;;
18        esac
19        return 0
20}
21
22
23fsck_dos() {
24        fsck_dosfsck "$@"
25}
26
27fsck_vfat() {
28        fsck_dosfsck "$@"
29}
30
31append libmount_known_fsck "dos"
32append libmount_known_fsck "vfat"
33