From 5a6de1e62864a5c1544b55896fd99bee3b497f87 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sat, 31 Jan 2009 12:55:55 +0000 Subject: Add e2fsck init script - scans every ext2/ext3 mount from fstab Signed-off-by: Vasilis Tsiligiannis SVN-Revision: 14301 --- package/e2fsprogs/files/e2fsck.init | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 package/e2fsprogs/files/e2fsck.init (limited to 'package/e2fsprogs/files/e2fsck.init') diff --git a/package/e2fsprogs/files/e2fsck.init b/package/e2fsprogs/files/e2fsck.init new file mode 100644 index 0000000000..e66750c910 --- /dev/null +++ b/package/e2fsprogs/files/e2fsck.init @@ -0,0 +1,35 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 OpenWrt.org +# Vasilis Tsiligiannis + +START=15 + +e2fsck() { + local args + local cfg="$1" + + config_get device "$cfg" device + [ -b "$device" ] || return 0 + + config_get fstype "$cfg" fstype + case "$fstype" in + ext2|ext3) + /usr/sbin/e2fsck -p "$device" + local status="$?" + case "$status" in + 0|1) continue;; + 2) reboot;; + 4) echo "e2fsck ($device): Warning! Uncorrected errors.";; + *) echo "e2fsck ($device): Error $status. Check not complete.";; + esac + ;; + *) + ;; + esac +} + +start() { + config_load fstab + config_foreach e2fsck mount +} + -- cgit v1.2.3