aboutsummaryrefslogtreecommitdiff
path: root/utils/hfsprogs/files/hfsfsck.sh
blob: 8bcd2c1fde849e825d7216fa23aeb5aa9a165e8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
# Copyright 2015 OpenWrt.org
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

fsck_hfsfsck() {
	hfsfsck "$device" 2>&1 | logger -t "fstab: hfsfsck ($device)"
	local status="$?"
	case "$status" in
		0) ;; #success
		4) reboot;;
		8) echo "hfsfsck ($device): Warning! Uncorrected errors."| logger -t fstab
			return 1
			;;
		*) echo "hfsfsck ($device): Error $status. Check not complete."| logger -t fstab;;
	esac
	return 0
}

fsck_hfs() {
	fsck_hfsfsck "$@"
}

fsck_hfsplus() {
	fsck_hfsfsck "$@"
}

append libmount_known_fsck "hfs"
append libmount_known_fsck "hfsplus"