summaryrefslogtreecommitdiffstats
path: root/raid-check
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-11-16 21:49:27 +0100
committerFlorian Pritz <bluewind@xinu.at>2012-11-16 21:49:27 +0100
commit11884f7ef3235f4be3324e569fa804a07a5336bb (patch)
treea424ba37ecf0d8b118ffbba2929d61c3cca1a94a /raid-check
parentf7ee8760d8d7eea87cbde9ba68b42bb351090562 (diff)
downloadbin-11884f7ef3235f4be3324e569fa804a07a5336bb.tar.gz
bin-11884f7ef3235f4be3324e569fa804a07a5336bb.tar.xz
raid-check: allow to run on a single device
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'raid-check')
-rwxr-xr-xraid-check15
1 files changed, 11 insertions, 4 deletions
diff --git a/raid-check b/raid-check
index 2b7f7f2..81d3876 100755
--- a/raid-check
+++ b/raid-check
@@ -1,5 +1,12 @@
-#!/bin/sh
+#!/bin/bash
+
+if (($#>0)); then
+ for d in "$@"; do
+ echo check > /sys/block/$d/md/sync_action
+ done
+else
+ for f in /sys/block/md*/md/sync_action; do
+ echo check > $f
+ done
+fi
-for f in /sys/block/md*/md/sync_action; do
- echo check > $f
-done