1 2 3 4 5 6 7 8 9 10 11 12
#!/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