aboutsummaryrefslogtreecommitdiff
path: root/init.d/checkroot
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-11 12:13:46 +0000
committerRoy Marples <roy@marples.name>2008-01-11 12:13:46 +0000
commit3bf49a9bd19d5bbcf6976dd42b4f87f1b173e287 (patch)
tree8b4d6121f0d4b921566eeec2844c9bf76131de78 /init.d/checkroot
parent1f4422c72f968405a0b8bf56d4f9c3b619b1b80d (diff)
Adopt a more C style for scripts and remove vim settings.
Diffstat (limited to 'init.d/checkroot')
-rwxr-xr-xinit.d/checkroot17
1 files changed, 10 insertions, 7 deletions
diff --git a/init.d/checkroot b/init.d/checkroot
index 86052931..8e4bf645 100755
--- a/init.d/checkroot
+++ b/init.d/checkroot
@@ -5,11 +5,13 @@
description="Check the root filesystem according to /etc/fstab for errors \
and optionally repair them."
-depend() {
+depend()
+{
keywords notimeout
}
-do_mtab() {
+do_mtab()
+{
# Don't create mtab if /etc is readonly
if ! echo 2>/dev/null >/etc/mtab; then
ewarn "Skipping /etc/mtab initialization (ro root)"
@@ -28,12 +30,14 @@ do_mtab() {
eend 0
}
-root_rw() {
+root_rw()
+{
echo 2>/dev/null >/.test.$$ || return 1
rm -f /.test.$$
}
-do_fsck() {
+do_fsck()
+{
local retval=0 opts= root=
case "${RC_UNAME}" in
FreeBSD) opts="-F";;
@@ -104,7 +108,8 @@ do_fsck() {
fi
}
-start() {
+start()
+{
do_fsck || return 1
if ! root_rw; then
@@ -123,5 +128,3 @@ start() {
# We got here, so return 0
return 0
}
-
-# vim: set ts=4 :