[Lunar-commits] <moonbase> lunar-init: reboot automatically after filesystem check if needed

Auke Kok sofar at foo-projects.org
Sun Aug 9 03:12:40 CEST 2009


commit 7976b0df9d55366aca545abc30fcd3b36f848c59
Author: Paul Bredbury <brebs at sent.com>
Date:   Sun Aug 9 03:12:40 2009 +0200

    lunar-init: reboot automatically after filesystem check if needed
---
 utils/lunar-init/mount |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/utils/lunar-init/mount b/utils/lunar-init/mount
index 964ceee..c76c4aa 100644
--- a/utils/lunar-init/mount
+++ b/utils/lunar-init/mount
@@ -248,7 +248,10 @@ start()
 
 		# check filesystems
 		run_with_msg_and_exit_codes "Checking filesystems: " "fsck -A -T -C -y -V $FORCE" "0" "1" ""
-		if [ $? -ge 2 ]; then
+		if [ $? -eq 3 ]; then
+			# Filesystem errors corrected, and system should be rebooted
+			reboot  -f
+		elif [ $? -ge 2 ]; then
 		    echo ""
 		    echo " *** fsck failed! ***"
 		    echo ""


More information about the Lunar-commits mailing list