diff options
author | Florian Fainelli <florian@openwrt.org> | 2009-01-31 12:55:55 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2009-01-31 12:55:55 +0000 |
commit | 07cb5e56858239307685acfbe48f438cd36596c8 (patch) | |
tree | d96e202aaba96d0582bae187da811a8461753de1 /package/e2fsprogs/files | |
parent | 4f4ff4b4c36961adc82012c8c53f97e5b8658184 (diff) | |
download | master-187ad058-07cb5e56858239307685acfbe48f438cd36596c8.tar.gz master-187ad058-07cb5e56858239307685acfbe48f438cd36596c8.tar.bz2 master-187ad058-07cb5e56858239307685acfbe48f438cd36596c8.zip |
Add e2fsck init script - scans every ext2/ext3 mount from fstab
Signed-off-by: Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14301 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/e2fsprogs/files')
-rw-r--r-- | package/e2fsprogs/files/e2fsck.init | 35 |
1 files changed, 35 insertions, 0 deletions
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 <acinonyxs@yahoo.gr> + +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 +} + |