hfsfsck.sh 646 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # Copyright 2015 OpenWrt.org
  3. # This is free software, licensed under the GNU General Public License v2.
  4. # See /LICENSE for more information.
  5. #
  6. fsck_hfsfsck() {
  7. hfsfsck "$device" 2>&1 | logger -t "fstab: hfsfsck ($device)"
  8. local status="$?"
  9. case "$status" in
  10. 0) ;; #success
  11. 4) reboot;;
  12. 8) echo "hfsfsck ($device): Warning! Uncorrected errors."| logger -t fstab
  13. return 1
  14. ;;
  15. *) echo "hfsfsck ($device): Error $status. Check not complete."| logger -t fstab;;
  16. esac
  17. return 0
  18. }
  19. fsck_hfs() {
  20. fsck_hfsfsck "$@"
  21. }
  22. fsck_hfsplus() {
  23. fsck_hfsfsck "$@"
  24. }
  25. append libmount_known_fsck "hfs"
  26. append libmount_known_fsck "hfsplus"