Now the linx fsck man page has return codes, I find them different from the BSD's so adjust accordingly.
This commit is contained in:
parent
33d4fba5be
commit
cc14b55414
@ -27,7 +27,7 @@ _reboot() {
|
|||||||
|
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
local reboot_opts= fsck_opts= p= check_extra=
|
local fsck_opts= p= check_extra=
|
||||||
|
|
||||||
if [ -e /fastboot ]; then
|
if [ -e /fastboot ]; then
|
||||||
ewarn "Skipping fsck due to /fastboot"
|
ewarn "Skipping fsck due to /fastboot"
|
||||||
@ -60,21 +60,31 @@ start()
|
|||||||
fsck_opts="${fsck_opts} -R"
|
fsck_opts="${fsck_opts} -R"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
reboot_opts="-f"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
trap : INT QUIT
|
trap : INT QUIT
|
||||||
fsck ${fsck_args--p} ${fsck_opts} "$@"
|
fsck ${fsck_args--p} ${fsck_opts} "$@"
|
||||||
case $? in
|
case $? in
|
||||||
0) eend 0; return 0;;
|
0) eend 0; return 0;;
|
||||||
1) ewend 1 "Filesystems repaired"; return 0;;
|
1) ewend 1 "Filesystems repaired"; return 0;;
|
||||||
2|3|4) ewend 1 "Filesystems repaired, but reboot needed"
|
2|3) if [ "${RC_UNAME}" = "Linux" ]; then
|
||||||
_reboot ${reboot_opts} || return 1;;
|
ewend 1 "Filesystems repaired, but reboot needed"
|
||||||
8) ewend 1 "Operational error"; return 0;;
|
_reboot -f
|
||||||
12) ewend 1 "fsck interupted"; return 1;;
|
else
|
||||||
*) eend 2 "Filesystems couldn't be fixed"
|
ewend 1 "Filesystems still have errors; manual fsck required"
|
||||||
_abort || return 1;;
|
fi;;
|
||||||
|
4) if [ "${RC_UNAME}" = "Linux" ]; then
|
||||||
|
ewend 1 "Fileystem errors left uncorrected"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
ewend 1 "Filesystems repaired, but reboot needed"
|
||||||
|
_reboot
|
||||||
|
fi;;
|
||||||
|
8) ewend 1 "Operational error"; return 0;;
|
||||||
|
12) ewend 1 "fsck interupted";;
|
||||||
|
*) eend 2 "Filesystems couldn't be fixed";;
|
||||||
esac
|
esac
|
||||||
|
_abort || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
stop()
|
stop()
|
||||||
|
Loading…
Reference in New Issue
Block a user